spyOn(mgrModuleService, 'list').and.returnValues(observableThrowError('z'), observableOf([]));
component.selection.selected.push({
name: 'foo',
- enabled: false
+ enabled: false,
+ always_on: false
});
component.selection.update();
component.updateModuleState();
spyOn(mgrModuleService, 'list').and.returnValue(observableOf([]));
component.selection.selected.push({
name: 'bar',
- enabled: true
+ enabled: true,
+ always_on: false
});
component.selection.update();
component.updateModuleState();
expect(component.blockUI.stop).toHaveBeenCalled();
expect(component.table.refreshBtn).toHaveBeenCalled();
}));
+
+ it('should not disable module (1)', () => {
+ component.selection.selected = [
+ {
+ name: 'dashboard'
+ }
+ ];
+ component.selection.update();
+ expect(component.isTableActionDisabled('enabled')).toBeTruthy();
+ });
+
+ it('should not disable module (2)', () => {
+ component.selection.selected = [
+ {
+ name: 'bar',
+ always_on: true
+ }
+ ];
+ component.selection.update();
+ expect(component.isTableActionDisabled('enabled')).toBeTruthy();
+ });
});
});