Disabled add section button when no options are available

This commit is contained in:
Giuseppe Digilio
2019-02-21 10:44:35 +01:00
parent b71e7fa8f2
commit c73b4c71bf
3 changed files with 17 additions and 6 deletions

View File

@@ -130,13 +130,18 @@ describe('SubmissionFormSectionAddComponent Component', () => {
fixture.detectChanges();
comp.sectionList.subscribe((list) => {
comp.sectionList$.subscribe((list) => {
expect(list).toEqual(mockAvailableSections);
})
});
comp.hasSections$.subscribe((hasSections) => {
expect(hasSections).toEqual(true);
})
});
it('should call addSection', () => {
submissionServiceStub.getDisabledSectionsList.and.returnValue(observableOf(mockAvailableSections));
comp.addSection(mockAvailableSections[1].id);
fixture.detectChanges();