Add test to ensure that file name is present in unsupported dialog

This commit is contained in:
Will Abson
2016-06-10 14:16:08 +01:00
parent fa6d54bad1
commit 76a01d572f
2 changed files with 14 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
<section class="section--center mdl-grid mdl-grid--no-spacing"> <section class="section--center mdl-grid mdl-grid--no-spacing">
<div class="viewer-margin mdl-card mdl-cell mdl-cell--9-col-desktop mdl-cell--6-col-tablet mdl-cell--4-col-phone mdl-shadow--2dp"> <div class="viewer-margin mdl-card mdl-cell mdl-cell--9-col-desktop mdl-cell--6-col-tablet mdl-cell--4-col-phone mdl-shadow--2dp">
<div class="viewer-download-text mdl-card__supporting-text"> <div class="viewer-download-text mdl-card__supporting-text">
<h4>File {{nameFile}} is an unsupported format</h4> <h4>File <span>{{nameFile}}</span> is an unsupported format</h4>
</div> </div>
<div class="center-element mdl-card__actions"> <div class="center-element mdl-card__actions">
<button id="viewer-download-button" class="viewer-margin center-element mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent" (click)="download()"> <button id="viewer-download-button" class="viewer-margin center-element mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent" (click)="download()">

View File

@@ -32,5 +32,18 @@ describe('Not Supported Format View', () => {
expect(element.querySelector('#viewer-download-button')).not.toBeNull(); expect(element.querySelector('#viewer-download-button')).not.toBeNull();
}); });
})); }));
it('should display the name of the file', injectAsync([TestComponentBuilder], (tcb: TestComponentBuilder) => {
return tcb
.createAsync(NotSupportedFormat)
.then((fixture) => {
let element = fixture.nativeElement;
let component = fixture.componentInstance;
component.nameFile = 'Example Content.xls';
fixture.detectChanges();
expect(element.querySelector('h4 span').innerHTML).toEqual('Example Content.xls');
});
}));
}); });
}); });