Skip to content

Commit

Permalink
remove duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
eromano committed Aug 1, 2017
1 parent cfa8a22 commit b639cf3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ enum LoginSteps {
Welcome = 2
}

enum LoginSteps {
Landing = 0,
Checking = 1,
Welcome = 2
}

@Component({
selector: 'adf-login, alfresco-login',
templateUrl: './login.component.html',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,47 +285,5 @@ describe('NotSupportedFormatComponent', () => {
expect(element.querySelector('#pdf-rendition-viewer')).not.toBeNull('Pdf rendition should be shown.');
});
});

describe('Conversion', () => {

function clickOnConvertButton() {
renditionSubject.next({ entry: { status: 'NOT_CREATED' } });
fixture.detectChanges();

let convertButton: any = element.querySelector('#viewer-convert-button');
convertButton.click();
fixture.detectChanges();
}

it('should show loading spinner and disable the "Convert to PDF button" after the button was clicked', () => {
clickOnConvertButton();

let convertButton: any = element.querySelector('#viewer-convert-button');
expect(element.querySelector('#conversion-spinner')).not.toBeNull('Conversion spinner should be shown');
expect(convertButton.disabled).toBe(true);
});

it('should re-enable the "Convert to PDF button" and hide spinner after unsuccessful conversion and hide loading spinner', () => {
clickOnConvertButton();

conversionSubject.error(new Error());
fixture.detectChanges();

let convertButton: any = element.querySelector('#viewer-convert-button');
expect(element.querySelector('#conversion-spinner')).toBeNull('Conversion spinner should be shown');
expect(convertButton.disabled).toBe(false);
});

it('should show the pdf rendition after successful conversion', () => {
clickOnConvertButton();

conversionSubject.next();
conversionSubject.complete();
fixture.detectChanges();
fixture.detectChanges();

expect(element.querySelector('#pdf-rendition-viewer')).not.toBeNull('Pdf rendition should be shown.');
});
});
});
});

0 comments on commit b639cf3

Please sign in to comment.