diff --git a/projects/dashboards-ng/src/components/dashboard-toolbar/si-dashboard-toolbar.component.spec.ts b/projects/dashboards-ng/src/components/dashboard-toolbar/si-dashboard-toolbar.component.spec.ts index 3981cd278..26208b455 100644 --- a/projects/dashboards-ng/src/components/dashboard-toolbar/si-dashboard-toolbar.component.spec.ts +++ b/projects/dashboards-ng/src/components/dashboard-toolbar/si-dashboard-toolbar.component.spec.ts @@ -29,13 +29,13 @@ describe('SiDashboardToolbarComponent', () => { }); it('#onEdit() shall set editable mode', async () => { - expect(component.editable()).toBeFalse(); + expect(component.editable()).toBe(false); const button = fixture.debugElement.query(By.css('button')); button.triggerEventHandler('click', null); await fixture.whenStable(); fixture.detectChanges(); - expect(component.editable()).toBeTrue(); + expect(component.editable()).toBe(true); const buttons = fixture.debugElement.queryAll(By.css('button')); expect(buttons.length).toBe(2); }); @@ -51,7 +51,7 @@ describe('SiDashboardToolbarComponent', () => { await fixture.whenStable(); fixture.detectChanges(); - expect(component.editable()).withContext('Cancel shall not change editable state').toBeTrue(); + expect(component.editable()).withContext('Cancel shall not change editable state').toBe(true); }); it('#onSave() shall cancel editable mode and emit save', async () => { @@ -65,11 +65,11 @@ describe('SiDashboardToolbarComponent', () => { await fixture.whenStable(); fixture.detectChanges(); - expect(component.editable()).withContext('Save shall not change editable state').toBeTrue(); + expect(component.editable()).withContext('Save shall not change editable state').toBe(true); }); it('#hideEditButton shall hide the edit button', () => { - expect(component.editable()).toBeFalse(); + expect(component.editable()).toBe(false); let editButton = fixture.debugElement.query(By.css('.element-edit')); expect(editButton).not.toBeNull(); expect(editButton).toBeDefined(); diff --git a/projects/dashboards-ng/src/components/flexible-dashboard/si-flexible-dashboard.component.spec.ts b/projects/dashboards-ng/src/components/flexible-dashboard/si-flexible-dashboard.component.spec.ts index 80eb0a80c..c89112d79 100644 --- a/projects/dashboards-ng/src/components/flexible-dashboard/si-flexible-dashboard.component.spec.ts +++ b/projects/dashboards-ng/src/components/flexible-dashboard/si-flexible-dashboard.component.spec.ts @@ -198,16 +198,16 @@ describe('SiFlexibleDashboardComponent', () => { it('should call #grid.edit() on changing editable input to true', () => { const spy = spyOn(grid, 'edit').and.callThrough(); - expect(component.editable()).toBeFalse(); + expect(component.editable()).toBe(false); fixture.componentRef.setInput('editable', true); component.ngOnChanges({ editable: new SimpleChange(false, true, true) }); expect(spy).toHaveBeenCalled(); }); it('should call #grid.cancel() on changing editable input to false', () => { - expect(component.editable()).toBeFalse(); + expect(component.editable()).toBe(false); grid.editable.set(true); - expect(component.editable()).toBeTrue(); + expect(component.editable()).toBe(true); const spy = spyOn(grid, 'cancel').and.callThrough(); fixture.componentRef.setInput('editable', false); @@ -217,7 +217,7 @@ describe('SiFlexibleDashboardComponent', () => { it('should emit editableChange events on changing grid editable state', () => { grid.editable.set(true); - expect(component.editable()).toBeTrue(); + expect(component.editable()).toBe(true); }); it('should restore the dashboard on dashboardId changes when dashboard is expanded', () => { diff --git a/projects/dashboards-ng/src/components/grid/si-grid.component.spec.ts b/projects/dashboards-ng/src/components/grid/si-grid.component.spec.ts index df780ede3..b0992bf1a 100644 --- a/projects/dashboards-ng/src/components/grid/si-grid.component.spec.ts +++ b/projects/dashboards-ng/src/components/grid/si-grid.component.spec.ts @@ -74,51 +74,51 @@ describe('SiGridComponent', () => { }); it('#edit() should change editable state to true', () => { - expect(component.editable()).toBeFalse(); + expect(component.editable()).toBe(false); component.edit(); - expect(component.editable()).toBeTrue(); + expect(component.editable()).toBe(true); }); it('#cancel() should change editable state to false', () => { fixture.componentRef.setInput('editable', true); fixture.detectChanges(); - expect(component.editable()).toBeTrue(); + expect(component.editable()).toBe(true); component.cancel(); - expect(component.editable()).toBeFalse(); + expect(component.editable()).toBe(false); }); describe('#save()', () => { it('should change editable state to false', async () => { fixture.componentRef.setInput('editable', true); fixture.detectChanges(); - expect(component.editable()).toBeTrue(); + expect(component.editable()).toBe(true); const spy = spyOn(widgetStorage, 'save').and.callThrough(); component.save(); expect(spy).toHaveBeenCalled(); - expect(component.editable()).toBeFalse(); + expect(component.editable()).toBe(false); }); }); it('should call edit() on setting editable to true', () => { const spy = spyOn(component, 'edit').and.callThrough(); - expect(component.editable()).toBeFalse(); + expect(component.editable()).toBe(false); fixture.componentRef.setInput('editable', true); component.ngOnChanges({ editable: new SimpleChange(false, true, false) }); expect(spy).toHaveBeenCalled(); - expect(component.editable()).toBeTrue(); + expect(component.editable()).toBe(true); }); it('should call cancel() on setting editable to false', () => { const spy = spyOn(component, 'cancel').and.callThrough(); fixture.componentRef.setInput('editable', true); - expect(component.editable()).toBeTrue(); + expect(component.editable()).toBe(true); expect(spy).not.toHaveBeenCalled(); fixture.componentRef.setInput('editable', false); component.ngOnChanges({ editable: new SimpleChange(true, false, false) }); expect(spy).toHaveBeenCalled(); - expect(component.editable()).toBeFalse(); + expect(component.editable()).toBe(false); }); it('#addWidget() shall add a new WidgetConfig to the visible widgets of the grid and assign unique ids', () => { @@ -192,7 +192,7 @@ describe('SiGridComponent', () => { component.edit(); component.isModified.subscribe(modified => { - expect(modified).toBeTrue(); + expect(modified).toBe(true); }); fixture.debugElement .query(By.css('si-gridstack-wrapper')) diff --git a/projects/dashboards-ng/src/components/widget-host/si-widget-host.component.spec.ts b/projects/dashboards-ng/src/components/widget-host/si-widget-host.component.spec.ts index 019e6c947..962ae7440 100644 --- a/projects/dashboards-ng/src/components/widget-host/si-widget-host.component.spec.ts +++ b/projects/dashboards-ng/src/components/widget-host/si-widget-host.component.spec.ts @@ -148,7 +148,7 @@ describe('SiWidgetHostComponent', () => { expect((component.primaryActions[0] as MenuItem).title).toBe('Hello User'); expect(component.primaryActions[1]).toBe(component.editAction); expect(component.primaryActions[2]).toBe(component.removeAction); - expect(component.widgetInstance!.editable).toBeTrue(); + expect(component.widgetInstance!.editable).toBe(true); jasmine.clock().uninstall(); }); @@ -163,7 +163,7 @@ describe('SiWidgetHostComponent', () => { expect(component.primaryActions.length).toBe(2); expect(component.primaryActions[0]).toBe(component.editAction); expect(component.primaryActions[1]).toBe(component.removeAction); - expect(component.widgetInstance!.editable).toBeTrue(); + expect(component.widgetInstance!.editable).toBe(true); jasmine.clock().uninstall(); }); }); diff --git a/projects/dashboards-ng/src/widget-loader.spec.ts b/projects/dashboards-ng/src/widget-loader.spec.ts index 855e04750..2e16caced 100644 --- a/projects/dashboards-ng/src/widget-loader.spec.ts +++ b/projects/dashboards-ng/src/widget-loader.spec.ts @@ -33,13 +33,13 @@ describe('widget-loader', () => { describe('widgetFactoryRegistry', () => { it('#hasFactoryFn() should return false for a not existing factory function', () => { - expect(widgetFactoryRegistry.hasFactoryFn('nothing')).toBeFalse(); + expect(widgetFactoryRegistry.hasFactoryFn('nothing')).toBe(false); }); it('#register() should add a factory function to the registry', () => { const factoryFn = {} as SetupComponentFn; widgetFactoryRegistry.register('my-function', factoryFn); - expect(widgetFactoryRegistry.hasFactoryFn('my-function')).toBeTrue(); + expect(widgetFactoryRegistry.hasFactoryFn('my-function')).toBe(true); expect(widgetFactoryRegistry.getFactoryFn('my-function')).toBe(factoryFn); }); }); diff --git a/projects/element-ng/accordion/si-collapsible-panel.component.spec.ts b/projects/element-ng/accordion/si-collapsible-panel.component.spec.ts index bfcb15428..f39cab849 100644 --- a/projects/element-ng/accordion/si-collapsible-panel.component.spec.ts +++ b/projects/element-ng/accordion/si-collapsible-panel.component.spec.ts @@ -65,12 +65,12 @@ describe('SiCollapsiblePanel', () => { fixture.detectChanges(); const header = element.querySelector('.collapsible-header') as HTMLElement; - expect(header.classList.contains('open')).toBeFalse(); + expect(header.classList.contains('open')).toBe(false); toggleCollapsePanel(); fixture.detectChanges(); - expect(header.classList.contains('open')).toBeTrue(); + expect(header.classList.contains('open')).toBe(true); const content = element.querySelector('.collapsible-content') as HTMLElement; expect(content.innerHTML).toContain('This is the content'); @@ -81,12 +81,12 @@ describe('SiCollapsiblePanel', () => { fixture.detectChanges(); const header = element.querySelector('.collapsible-header') as HTMLElement; - expect(header.classList.contains('open')).toBeFalse(); + expect(header.classList.contains('open')).toBe(false); toggleCollapsePanel(); fixture.detectChanges(); - expect(header.classList.contains('open')).toBeTrue(); + expect(header.classList.contains('open')).toBe(true); const content = element.querySelector('.collapsible-content') as HTMLElement; expect(content.innerHTML).toContain('This is the content'); @@ -94,7 +94,7 @@ describe('SiCollapsiblePanel', () => { toggleCollapsePanel(); fixture.detectChanges(); - expect(header.classList.contains('open')).toBeFalse(); + expect(header.classList.contains('open')).toBe(false); }); it('should show show custom header selected by si-panel-heading directive', () => { component.heading = 'This is the highlighted heading'; diff --git a/projects/element-ng/application-header/launchpad/si-launchpad.spec.ts b/projects/element-ng/application-header/launchpad/si-launchpad.spec.ts index 407b9c839..f0371da95 100644 --- a/projects/element-ng/application-header/launchpad/si-launchpad.spec.ts +++ b/projects/element-ng/application-header/launchpad/si-launchpad.spec.ts @@ -59,7 +59,7 @@ describe('SiLaunchpad', () => { } ]; fixture.changeDetectorRef.markForCheck(); - expect(await harness.hasToggle()).toBeTrue(); + expect(await harness.hasToggle()).toBe(true); expect(await harness.getCategories()).toHaveSize(1); await harness.toggleMore(); expect(await harness.getCategories()).toHaveSize(2); @@ -111,7 +111,7 @@ describe('SiLaunchpad', () => { expect(categories).toHaveSize(2); expect(await categories[0].getName()).toBe('Favorites'); expect(await categories[1].getName()).toBe(null); - expect(await harness.getApp('A-1').then(app => app.isFavorite())).toBeTrue(); + expect(await harness.getApp('A-1').then(app => app.isFavorite())).toBe(true); expect(await harness.getFavoriteCategory().then(category => category.getApps())).toHaveSize( 1 ); @@ -132,7 +132,7 @@ describe('SiLaunchpad', () => { } ]; fixture.changeDetectorRef.markForCheck(); - expect(await harness.hasToggle()).toBeFalse(); + expect(await harness.hasToggle()).toBe(false); expect(await harness.getCategories()).toHaveSize(1); }); }); @@ -144,7 +144,7 @@ describe('SiLaunchpad', () => { { name: 'A-2', href: '/a-2' } ]; fixture.changeDetectorRef.markForCheck(); - expect(await harness.hasToggle()).toBeFalse(); + expect(await harness.hasToggle()).toBe(false); }); }); }); diff --git a/projects/element-ng/application-header/si-application-header.component.spec.ts b/projects/element-ng/application-header/si-application-header.component.spec.ts index 132ce02af..037283fe4 100644 --- a/projects/element-ng/application-header/si-application-header.component.spec.ts +++ b/projects/element-ng/application-header/si-application-header.component.spec.ts @@ -103,73 +103,73 @@ describe('SiApplicationHeaderComponent', () => { it('should have backdrop for nav-item opened', async () => { await headerHarness.openNavigationMobile(); - expect(await headerHarness.hasBackdrop()).toBeTrue(); + expect(await headerHarness.hasBackdrop()).toBe(true); const navItemHarness = await headerHarness.getNavigationItem('NavItem'); await navItemHarness.toggle(); - expect(await headerHarness.hasBackdrop()).toBeTrue(); + expect(await headerHarness.hasBackdrop()).toBe(true); await headerHarness.clickBackdrop(); - expect(await headerHarness.hasBackdrop()).toBeFalse(); + expect(await headerHarness.hasBackdrop()).toBe(false); }); it('should have backdrop for action-item opened', async () => { const actionItemHarness = await headerHarness.getActionItem('AItem 1'); await actionItemHarness.toggle(); - expect(await headerHarness.hasBackdrop()).toBeTrue(); + expect(await headerHarness.hasBackdrop()).toBe(true); await actionItemHarness .getDropdown() .then(dropdown => dropdown.getItem('DItem 1')) .then(d1 => d1.click()); - expect(await headerHarness.hasBackdrop()).toBeTrue(); + expect(await headerHarness.hasBackdrop()).toBe(true); await headerHarness.clickBackdrop(); - expect(await headerHarness.hasBackdrop()).toBeFalse(); + expect(await headerHarness.hasBackdrop()).toBe(false); }); it('should have backdrop for collapsible action-item opened', async () => { await headerHarness.openCollapsibleActions(); - expect(await headerHarness.hasBackdrop()).toBeTrue(); + expect(await headerHarness.hasBackdrop()).toBe(true); const actionItemHarness = await headerHarness.getActionItem('AItem 2'); await actionItemHarness.toggle(); - expect(await headerHarness.hasBackdrop()).toBeTrue(); + expect(await headerHarness.hasBackdrop()).toBe(true); await headerHarness.clickBackdrop(); - expect(await headerHarness.hasBackdrop()).toBeFalse(); + expect(await headerHarness.hasBackdrop()).toBe(false); }); it('should close others if nav opened', async () => { const actionItemHarness = await headerHarness.getActionItem('AItem 1'); await actionItemHarness.toggle(); - expect(await headerHarness.hasBackdrop()).toBeTrue(); - expect(await actionItemHarness.isOpen()).toBeTrue(); + expect(await headerHarness.hasBackdrop()).toBe(true); + expect(await actionItemHarness.isOpen()).toBe(true); await headerHarness.openNavigationMobile(); - expect(await actionItemHarness.isOpen()).toBeFalse(); - expect(await headerHarness.hasBackdrop()).toBeTrue(); + expect(await actionItemHarness.isOpen()).toBe(false); + expect(await headerHarness.hasBackdrop()).toBe(true); }); it('should close others if action-item opened', async () => { await headerHarness.openCollapsibleActions(); - expect(await headerHarness.hasBackdrop()).toBeTrue(); + expect(await headerHarness.hasBackdrop()).toBe(true); await headerHarness.getActionItem('AItem 1').then(item => item.toggle()); - expect(await headerHarness.isCollapsibleActionsOpen()).toBeFalse(); - expect(await headerHarness.hasBackdrop()).toBeTrue(); + expect(await headerHarness.isCollapsibleActionsOpen()).toBe(false); + expect(await headerHarness.hasBackdrop()).toBe(true); }); it('should close others if collapsible actions opened', async () => { await headerHarness.openNavigationMobile(); - expect(await headerHarness.hasBackdrop()).toBeTrue(); + expect(await headerHarness.hasBackdrop()).toBe(true); await headerHarness.openCollapsibleActions(); - expect(await headerHarness.isNavigationMobileOpen()).toBeFalse(); - expect(await headerHarness.hasBackdrop()).toBeTrue(); + expect(await headerHarness.isNavigationMobileOpen()).toBe(false); + expect(await headerHarness.hasBackdrop()).toBe(true); }); it('should keep collapsible actions open if dropdowns are opened inside', async () => { await headerHarness.openCollapsibleActions(); - expect(await headerHarness.isCollapsibleActionsOpen()).toBeTrue(); + expect(await headerHarness.isCollapsibleActionsOpen()).toBe(true); const actionItemHarness = await headerHarness.getActionItem('AItem 2'); await actionItemHarness.toggle(); await actionItemHarness .getDropdown() .then(dropdown => dropdown.getItem('DItem 1')) .then(d1 => d1.click()); - expect(await headerHarness.isCollapsibleActionsOpen()).toBeTrue(); + expect(await headerHarness.isCollapsibleActionsOpen()).toBe(true); }); }); @@ -222,7 +222,7 @@ describe('SiApplicationHeaderComponent', () => { it('should show a dot for booleans', async () => { component.bade1 = true; await runOnPushChangeDetection(fixture); - expect(await actionItem1Harness.hasBadgeDot()).toBeTrue(); + expect(await actionItem1Harness.hasBadgeDot()).toBe(true); }); it('should show a text for numbers', async () => { @@ -232,28 +232,28 @@ describe('SiApplicationHeaderComponent', () => { }); it('should update parent account', async () => { - expect(await headerHarness.hasCollapsibleActionsBadge()).toBeFalse(); + expect(await headerHarness.hasCollapsibleActionsBadge()).toBe(false); component.bade1 = 1; await runOnPushChangeDetection(fixture); - expect(await headerHarness.hasCollapsibleActionsBadge()).toBeTrue(); + expect(await headerHarness.hasCollapsibleActionsBadge()).toBe(true); component.bade2 = true; await runOnPushChangeDetection(fixture); - expect(await headerHarness.hasCollapsibleActionsBadge()).toBeTrue(); + expect(await headerHarness.hasCollapsibleActionsBadge()).toBe(true); component.bade1 = 0; await runOnPushChangeDetection(fixture); - expect(await headerHarness.hasCollapsibleActionsBadge()).toBeTrue(); + expect(await headerHarness.hasCollapsibleActionsBadge()).toBe(true); component.bade2 = false; await runOnPushChangeDetection(fixture); - expect(await headerHarness.hasCollapsibleActionsBadge()).toBeFalse(); + expect(await headerHarness.hasCollapsibleActionsBadge()).toBe(false); component.bade1 = true; await runOnPushChangeDetection(fixture); - expect(await headerHarness.hasCollapsibleActionsBadge()).toBeTrue(); + expect(await headerHarness.hasCollapsibleActionsBadge()).toBe(true); component.bade1 = 1; await runOnPushChangeDetection(fixture); - expect(await headerHarness.hasCollapsibleActionsBadge()).toBeTrue(); + expect(await headerHarness.hasCollapsibleActionsBadge()).toBe(true); component.bade1 = false; await runOnPushChangeDetection(fixture); - expect(await headerHarness.hasCollapsibleActionsBadge()).toBeFalse(); + expect(await headerHarness.hasCollapsibleActionsBadge()).toBe(false); }); }); @@ -303,16 +303,16 @@ describe('SiApplicationHeaderComponent', () => { it('should close mobile navigation on expand', async () => { await headerHarness.openNavigationMobile(); - expect(await headerHarness.isNavigationMobileOpen()).toBeTrue(); + expect(await headerHarness.isNavigationMobileOpen()).toBe(true); breakpointObserver.observeResult.next({ matches: false, breakpoints: {} }); - expect(await headerHarness.isNavigationMobileOpen()).toBeFalse(); + expect(await headerHarness.isNavigationMobileOpen()).toBe(false); }); it('should close collapsible actions on expand', async () => { await headerHarness.openCollapsibleActions(); - expect(await headerHarness.isCollapsibleActionsOpen()).toBeTrue(); + expect(await headerHarness.isCollapsibleActionsOpen()).toBe(true); breakpointObserver.observeResult.next({ matches: false, breakpoints: {} }); - expect(await headerHarness.isCollapsibleActionsOpen()).toBeFalse(); + expect(await headerHarness.isCollapsibleActionsOpen()).toBe(false); }); }); @@ -342,9 +342,9 @@ describe('SiApplicationHeaderComponent', () => { it('should close other when open launchpad', async () => { await headerHarness.openNavigationMobile(); - expect(await headerHarness.isNavigationMobileOpen()).toBeTrue(); + expect(await headerHarness.isNavigationMobileOpen()).toBe(true); await headerHarness.openLaunchpad(); - expect(await headerHarness.isNavigationMobileOpen()).toBeFalse(); + expect(await headerHarness.isNavigationMobileOpen()).toBe(false); expect(await headerHarness.getLaunchpad()).toBeTruthy(); }); @@ -353,7 +353,7 @@ describe('SiApplicationHeaderComponent', () => { expect(await headerHarness.getLaunchpad()).toBeTruthy(); await headerHarness.openNavigationMobile(); expect(await headerHarness.getLaunchpad()).toBeFalsy(); - expect(await headerHarness.isNavigationMobileOpen()).toBeTrue(); + expect(await headerHarness.isNavigationMobileOpen()).toBe(true); }); }); }); diff --git a/projects/element-ng/breadcrumb/si-breadcrumb.component.spec.ts b/projects/element-ng/breadcrumb/si-breadcrumb.component.spec.ts index 57425027a..f81a4d1c0 100644 --- a/projects/element-ng/breadcrumb/si-breadcrumb.component.spec.ts +++ b/projects/element-ng/breadcrumb/si-breadcrumb.component.spec.ts @@ -127,18 +127,18 @@ describe('SiBreadcrumbComponent', () => { fixture.detectChanges(); let breadcrumb = element.querySelector('.breadcrumb')!; - expect(breadcrumb.querySelector('a')?.classList.contains('active')).toBeTrue(); - expect(breadcrumb.querySelectorAll('a')[1]?.classList.contains('active')).toBeFalse(); - expect(breadcrumb.querySelectorAll('a')[2]?.classList.contains('active')).toBeFalse(); + expect(breadcrumb.querySelector('a')?.classList.contains('active')).toBe(true); + expect(breadcrumb.querySelectorAll('a')[1]?.classList.contains('active')).toBe(false); + expect(breadcrumb.querySelectorAll('a')[2]?.classList.contains('active')).toBe(false); await router.navigate(['pages']); fixture.detectChanges(); breadcrumb = element.querySelector('.breadcrumb')!; - expect(breadcrumb.querySelector('a')?.classList.contains('active')).toBeFalse(); - expect(breadcrumb.querySelectorAll('a')[1]?.classList.contains('active')).toBeTrue(); - expect(breadcrumb.querySelectorAll('a')[2]?.classList.contains('active')).toBeFalse(); + expect(breadcrumb.querySelector('a')?.classList.contains('active')).toBe(false); + expect(breadcrumb.querySelectorAll('a')[1]?.classList.contains('active')).toBe(true); + expect(breadcrumb.querySelectorAll('a')[2]?.classList.contains('active')).toBe(false); }); it('should update items on translate', () => { diff --git a/projects/element-ng/circle-status/si-circle-status.component.spec.ts b/projects/element-ng/circle-status/si-circle-status.component.spec.ts index 8cc2c3113..7fb65d76c 100644 --- a/projects/element-ng/circle-status/si-circle-status.component.spec.ts +++ b/projects/element-ng/circle-status/si-circle-status.component.spec.ts @@ -77,11 +77,11 @@ describe('SiCircleStatusComponent', () => { }); fixture.detectChanges(); const statusIndication = element.querySelector('.status-indication .bg') as HTMLElement; - expect(statusIndication.classList.contains('pulse')).toBeFalse(); + expect(statusIndication.classList.contains('pulse')).toBe(false); jasmine.clock().tick(4 * 1400); fixture.detectChanges(); - expect(statusIndication.classList.contains('pulse')).toBeTrue(); + expect(statusIndication.classList.contains('pulse')).toBe(true); component.ngOnDestroy(); jasmine.clock().uninstall(); }); diff --git a/projects/element-ng/color-picker/si-color-picker.component.spec.ts b/projects/element-ng/color-picker/si-color-picker.component.spec.ts index b6e20114c..3cda3ebe4 100644 --- a/projects/element-ng/color-picker/si-color-picker.component.spec.ts +++ b/projects/element-ng/color-picker/si-color-picker.component.spec.ts @@ -129,7 +129,7 @@ describe('SiColorPickerComponent', () => { it('should not mark as dirty if the overlay is opened', () => { element.click(); fixture.detectChanges(); - expect(host.colorPickerControl.dirty).toBeFalse(); + expect(host.colorPickerControl.dirty).toBe(false); }); it('should mark as dirty if the input is blurred', () => { @@ -145,7 +145,7 @@ describe('SiColorPickerComponent', () => { element.dispatchEvent(new Event('blur')); fixture.detectChanges(); - expect(host.colorPickerControl.dirty).toBeTrue(); + expect(host.colorPickerControl.dirty).toBe(true); }); it('should read and write the form value', () => { diff --git a/projects/element-ng/column-selection-dialog/si-column-selection-dialog.component.spec.ts b/projects/element-ng/column-selection-dialog/si-column-selection-dialog.component.spec.ts index 9f1bcd8cb..5c7cdd3b1 100644 --- a/projects/element-ng/column-selection-dialog/si-column-selection-dialog.component.spec.ts +++ b/projects/element-ng/column-selection-dialog/si-column-selection-dialog.component.spec.ts @@ -187,7 +187,7 @@ describe('ColumnDialogComponent', () => { expect( Array.from(dragItems).every(dragItem => dragItem.classList.contains('cdk-drag-disabled')) - ).toBeFalse(); + ).toBe(false); }); it('should not force columns to be draggable if previous/next are', () => { @@ -206,7 +206,7 @@ describe('ColumnDialogComponent', () => { dragItems .slice(1, dragItems.length - 1) .every(dragItem => !dragItem.classList.contains('cdk-drag-disabled')) - ).toBeFalse(); + ).toBe(false); }); it('should move items on drop', () => { diff --git a/projects/element-ng/common/services/blink.service.spec.ts b/projects/element-ng/common/services/blink.service.spec.ts index 1436fe31b..96483f043 100644 --- a/projects/element-ng/common/services/blink.service.spec.ts +++ b/projects/element-ng/common/services/blink.service.spec.ts @@ -63,7 +63,7 @@ describe('BlinkService', () => { expect(counter).toBe(1); // 1 startup service.pause(); - expect(service.isPaused()).toBeTrue(); + expect(service.isPaused()).toBe(true); jasmine.clock().tick(4 * 1400); expect(counter).toBe(2); // 2 because an "off" is forced diff --git a/projects/element-ng/connection-strength/si-connection-strength.component.spec.ts b/projects/element-ng/connection-strength/si-connection-strength.component.spec.ts index a177f972e..4bc7fc2b4 100644 --- a/projects/element-ng/connection-strength/si-connection-strength.component.spec.ts +++ b/projects/element-ng/connection-strength/si-connection-strength.component.spec.ts @@ -27,14 +27,14 @@ describe('SiConnectionStrengthComponent', () => { component.setInput('value', 'none'); fixture.detectChanges(); - expect(element.querySelector('svg')!.classList.contains('none')).toBeTrue(); + expect(element.querySelector('svg')!.classList.contains('none')).toBe(true); }); it('should display other value', () => { component.setInput('value', 'low'); fixture.detectChanges(); - expect(element.querySelector('svg')!.classList.contains('none')).toBeFalse(); + expect(element.querySelector('svg')!.classList.contains('none')).toBe(false); }); }); @@ -47,21 +47,21 @@ describe('SiConnectionStrengthComponent', () => { component.setInput('value', 'none'); fixture.detectChanges(); - expect(element.querySelector('svg')!.classList.contains('none')).toBeTrue(); + expect(element.querySelector('svg')!.classList.contains('none')).toBe(true); }); it('should display other value', () => { component.setInput('value', 'low'); fixture.detectChanges(); - expect(element.querySelector('svg')!.classList.contains('none')).toBeFalse(); + expect(element.querySelector('svg')!.classList.contains('none')).toBe(false); }); it('should display none if an incorrect value is set', () => { component.setInput('value', undefined); fixture.detectChanges(); - expect(element.querySelector('svg')!.classList.contains('none')).toBeTrue(); + expect(element.querySelector('svg')!.classList.contains('none')).toBe(true); }); }); }); diff --git a/projects/element-ng/content-action-bar/si-content-action-bar.component.spec.ts b/projects/element-ng/content-action-bar/si-content-action-bar.component.spec.ts index 9ba06947c..8e1c243aa 100644 --- a/projects/element-ng/content-action-bar/si-content-action-bar.component.spec.ts +++ b/projects/element-ng/content-action-bar/si-content-action-bar.component.spec.ts @@ -115,10 +115,10 @@ describe('SiContentActionBarComponent', () => { // cannot use jasmine.clock here await new Promise(resolve => setTimeout(resolve, 50)); - expect(await harness.isPrimaryExpanded()).toBeFalse(); + expect(await harness.isPrimaryExpanded()).toBe(false); await harness.togglePrimary(); await fixture.whenStable(); - expect(await harness.isPrimaryExpanded()).toBeTrue(); + expect(await harness.isPrimaryExpanded()).toBe(true); }); it('should disable menu item by disabled attribute', async () => { @@ -129,7 +129,7 @@ describe('SiContentActionBarComponent', () => { fixture.changeDetectorRef.markForCheck(); await fixture.whenStable(); - expect(await harness.getPrimaryAction('Item').then(item => item.isDisabled())).toBeTrue(); + expect(await harness.getPrimaryAction('Item').then(item => item.isDisabled())).toBe(true); }); it('should call action on item click', async () => { @@ -152,7 +152,7 @@ describe('SiContentActionBarComponent', () => { await fixture.whenStable(); expect( await harness.getPrimaryAction('primaryItem').then(item => item.hasIcon('element-user')) - ).toBeTrue(); + ).toBe(true); }); it('should show primary action icon in in menu', async () => { @@ -169,7 +169,7 @@ describe('SiContentActionBarComponent', () => { .getMobileMenu() .then(menu => menu.getItem('primaryItem')) .then(item => item.hasIcon('element-user')) - ).toBeTrue(); + ).toBe(true); }); it('should not show primary action icon in menus with mobile view', async () => { @@ -187,7 +187,7 @@ describe('SiContentActionBarComponent', () => { .getMobileMenu() .then(menu => menu.getItem('primaryItem')) .then(item => item.hasIcon('element-user')) - ).toBeFalse(); + ).toBe(false); }); it('should show secondary action icon in menu with expanded view', async () => { @@ -207,7 +207,7 @@ describe('SiContentActionBarComponent', () => { .getSecondaryMenu() .then(menu => menu.getItem('secondaryItem')) .then(item => item.hasIcon('element-copy')) - ).toBeTrue(); + ).toBe(true); }); it('should not show secondary action icon in menus with expanded view', async () => { @@ -228,7 +228,7 @@ describe('SiContentActionBarComponent', () => { .getMobileMenu() .then(menu => menu.getItem('secondaryItem')) .then(item => item.hasIcon('element-copy')) - ).toBeFalse(); + ).toBe(false); }); }); @@ -238,10 +238,10 @@ describe('SiContentActionBarComponent', () => { ]; fixture.changeDetectorRef.markForCheck(); await fixture.whenStable(); - expect(await harness.isMobile()).toBeFalse(); + expect(await harness.isMobile()).toBe(false); component.primaryActions = []; fixture.changeDetectorRef.markForCheck(); await fixture.whenStable(); - expect(await harness.isMobile()).toBeTrue(); + expect(await harness.isMobile()).toBe(true); }); }); diff --git a/projects/element-ng/dashboard/si-dashboard-card.component.spec.ts b/projects/element-ng/dashboard/si-dashboard-card.component.spec.ts index c11b9d3df..75fb968cc 100644 --- a/projects/element-ng/dashboard/si-dashboard-card.component.spec.ts +++ b/projects/element-ng/dashboard/si-dashboard-card.component.spec.ts @@ -166,10 +166,10 @@ describe('SiDashboardCardComponent', () => { it('expand and restore on by expand() and restore() api', () => { component.card().expand(); fixture.detectChanges(); - expect(component.card().isExpanded()).toBeTrue(); + expect(component.card().isExpanded()).toBe(true); component.card().restore(); fixture.detectChanges(); - expect(component.card().isExpanded()).toBeFalse(); + expect(component.card().isExpanded()).toBe(false); }); it('expand and restore on click', () => { @@ -179,12 +179,12 @@ describe('SiDashboardCardComponent', () => { .querySelector('si-content-action-bar button[aria-label="Expand"]')! .click(); fixture.detectChanges(); - expect(component.card().isExpanded()).toBeTrue(); + expect(component.card().isExpanded()).toBe(true); element .querySelector('si-content-action-bar button[aria-label="Restore"]')! .click(); fixture.detectChanges(); - expect(component.card().isExpanded()).toBeFalse(); + expect(component.card().isExpanded()).toBe(false); }); it('expand and restore on click with one primary action', () => { @@ -196,12 +196,12 @@ describe('SiDashboardCardComponent', () => { .querySelector('si-content-action-bar button[aria-label="Expand"]')! .click(); fixture.detectChanges(); - expect(component.card().isExpanded()).toBeTrue(); + expect(component.card().isExpanded()).toBe(true); element .querySelector('si-content-action-bar button[aria-label="Restore"]')! .click(); fixture.detectChanges(); - expect(component.card().isExpanded()).toBeFalse(); + expect(component.card().isExpanded()).toBe(false); }); it('expand and restore on click with one secondary action', () => { @@ -212,11 +212,11 @@ describe('SiDashboardCardComponent', () => { .querySelector('si-content-action-bar button[aria-label="Expand"]')! .click(); fixture.detectChanges(); - expect(component.card().isExpanded()).toBeTrue(); + expect(component.card().isExpanded()).toBe(true); element .querySelector('si-content-action-bar button[aria-label="Restore"]')! .click(); fixture.detectChanges(); - expect(component.card().isExpanded()).toBeFalse(); + expect(component.card().isExpanded()).toBe(false); }); }); diff --git a/projects/element-ng/dashboard/si-dashboard.component.spec.ts b/projects/element-ng/dashboard/si-dashboard.component.spec.ts index c09ebd309..810c6ba5d 100644 --- a/projects/element-ng/dashboard/si-dashboard.component.spec.ts +++ b/projects/element-ng/dashboard/si-dashboard.component.spec.ts @@ -102,7 +102,7 @@ describe('SiDashboardComponent', () => { it('should show expand menu', () => { component.cardComponents().forEach(c => { - expect(c.enableExpandInteractionComputed()).toBeTrue(); + expect(c.enableExpandInteractionComputed()).toBe(true); }); }); @@ -119,7 +119,7 @@ describe('SiDashboardComponent', () => { component.cardComponents().at(-1)!.restore(); expect(expandSpy).toHaveBeenCalled(); - expect(component.cardComponents().at(-1)!.hide).toBeFalse(); + expect(component.cardComponents().at(-1)!.hide).toBe(false); }); }); @@ -137,7 +137,7 @@ describe('SiDashboardComponent', () => { it('#expand() shall expand a card', () => { let expandDiv = fixture.debugElement.queryAll(By.css('div.position-relative'))[0]; expect(expandDiv).toBeDefined(); - expect(expandDiv.classes['d-none']).toBeTrue(); + expect(expandDiv.classes['d-none']).toBe(true); const card = component.cardComponents().at(-1)!; expect(card).toBeDefined(); diff --git a/projects/element-ng/date-range-filter/si-date-range-calculation.service.spec.ts b/projects/element-ng/date-range-filter/si-date-range-calculation.service.spec.ts index 4a60c3832..b3bbcb08e 100644 --- a/projects/element-ng/date-range-filter/si-date-range-calculation.service.spec.ts +++ b/projects/element-ng/date-range-filter/si-date-range-calculation.service.spec.ts @@ -32,7 +32,7 @@ describe('SiDateRangeCalculationService', () => { }; const resolved = service.resolveDateRangeFilter(filter); - expect(resolved.valid).toBeTrue(); + expect(resolved.valid).toBe(true); compareDates(resolved.start, new Date('2023-07-08')); compareDates(resolved.end, new Date('2023-07-15')); }); @@ -47,7 +47,7 @@ describe('SiDateRangeCalculationService', () => { const start = new Date(end.getTime() - 7 * ONE_DAY); const resolved = service.resolveDateRangeFilter(filter); - expect(resolved.valid).toBeTrue(); + expect(resolved.valid).toBe(true); compareDates(resolved.start, start); compareDates(resolved.end, end); }); @@ -62,7 +62,7 @@ describe('SiDateRangeCalculationService', () => { const start = new Date('2023-05-07'); const resolved = service.resolveDateRangeFilter(filter); - expect(resolved.valid).toBeTrue(); + expect(resolved.valid).toBe(true); compareDates(resolved.start, start); compareDates(resolved.end, end); }); @@ -75,7 +75,7 @@ describe('SiDateRangeCalculationService', () => { }; const resolved = service.resolveDateRangeFilter(filter); - expect(resolved.valid).toBeTrue(); + expect(resolved.valid).toBe(true); compareDates(resolved.start, new Date('2023-07-15')); compareDates(resolved.end, new Date('2023-07-22')); }); @@ -88,7 +88,7 @@ describe('SiDateRangeCalculationService', () => { }; const resolved = service.resolveDateRangeFilter(filter); - expect(resolved.valid).toBeTrue(); + expect(resolved.valid).toBe(true); compareDates(resolved.start, new Date('2023-07-08')); compareDates(resolved.end, new Date('2023-07-22')); }); @@ -100,7 +100,7 @@ describe('SiDateRangeCalculationService', () => { }; const resolved = service.resolveDateRangeFilter(filter); - expect(resolved.valid).toBeTrue(); + expect(resolved.valid).toBe(true); compareDates(resolved.start, new Date('2023-06-17')); compareDates(resolved.end, new Date('2023-07-15')); }); diff --git a/projects/element-ng/date-range-filter/si-date-range-filter.component.spec.ts b/projects/element-ng/date-range-filter/si-date-range-filter.component.spec.ts index d5992310d..dc8839fc1 100644 --- a/projects/element-ng/date-range-filter/si-date-range-filter.component.spec.ts +++ b/projects/element-ng/date-range-filter/si-date-range-filter.component.spec.ts @@ -120,7 +120,7 @@ describe('SiDateRangeFilterComponent', () => { const to = new Date(); const from = new Date(to.getTime() - 2 * ONE_DAY); - expect(advancedMode()).toBeTrue(); + expect(advancedMode()).toBe(true); expect(rangeInputValue()).toBe(2); expect(rangeSelectContent()).toBe('Days'); expect(preview()).toEqual(rangeText(from, to)); @@ -133,7 +133,7 @@ describe('SiDateRangeFilterComponent', () => { const from = new Date(); const to = new Date(from.getTime() + 2 * ONE_DAY); - expect(advancedMode()).toBeTrue(); + expect(advancedMode()).toBe(true); expect(rangeInputValue()).toBe(2); expect(rangeSelectContent()).toBe('Days'); expect(preview()).toEqual(rangeText(from, to)); @@ -152,7 +152,7 @@ describe('SiDateRangeFilterComponent', () => { await fixture.whenStable(); expect(preview()).toEqual(rangeText(from, to)); - expect(advancedMode()).toBeFalse(); + expect(advancedMode()).toBe(false); expect(date2string(component.range.point1 as Date)).toEqual(date2string(from)); expect(date2string(component.range.point2 as Date)).toEqual(date2string(to)); expect(component.range.range).toBeUndefined(); @@ -167,7 +167,7 @@ describe('SiDateRangeFilterComponent', () => { const from = new Date(); const to = new Date(from.getTime() + 2 * ONE_DAY); - expect(advancedMode()).toBeTrue(); + expect(advancedMode()).toBe(true); expect(preview()).toEqual(rangeText(from, to)); expect(component.range.point1).toEqual('now'); expect(component.range.point2).toEqual(2 * ONE_DAY); @@ -184,7 +184,7 @@ describe('SiDateRangeFilterComponent', () => { const from = new Date(now.getTime() - 2 * ONE_DAY); const to = new Date(now.getTime() + 2 * ONE_DAY); - expect(advancedMode()).toBeTrue(); + expect(advancedMode()).toBe(true); expect(preview()).toEqual(rangeText(from, to)); expect(component.range.point1).toEqual('now'); expect(component.range.point2).toEqual(2 * ONE_DAY); diff --git a/projects/element-ng/datepicker/components/si-compare-adapter.spec.ts b/projects/element-ng/datepicker/components/si-compare-adapter.spec.ts index d89602269..38e559c28 100644 --- a/projects/element-ng/datepicker/components/si-compare-adapter.spec.ts +++ b/projects/element-ng/datepicker/components/si-compare-adapter.spec.ts @@ -10,17 +10,17 @@ describe('CompareAdapter', () => { describe('isEqualOrBetween', () => { it('should be true', () => { const current = new Date(2022, 2, 15); - expect(dayCompare.isEqualOrBetween(current)).toBeTrue(); - expect(dayCompare.isEqualOrBetween(current, new Date(2022, 2, 15))).toBeTrue(); + expect(dayCompare.isEqualOrBetween(current)).toBe(true); + expect(dayCompare.isEqualOrBetween(current, new Date(2022, 2, 15))).toBe(true); expect( dayCompare.isEqualOrBetween(current, new Date(2022, 2, 15), new Date(2022, 2, 15)) - ).toBeTrue(); - expect(dayCompare.isEqualOrBetween(current, new Date(2022, 2, 14))).toBeTrue(); + ).toBe(true); + expect(dayCompare.isEqualOrBetween(current, new Date(2022, 2, 14))).toBe(true); expect( dayCompare.isEqualOrBetween(current, new Date(2022, 2, 14), new Date(2022, 2, 16)) - ).toBeTrue(); - expect(dayCompare.isEqualOrBetween(current, undefined, new Date(2022, 2, 15))).toBeTrue(); - expect(dayCompare.isEqualOrBetween(current, undefined, new Date(2022, 2, 16))).toBeTrue(); + ).toBe(true); + expect(dayCompare.isEqualOrBetween(current, undefined, new Date(2022, 2, 15))).toBe(true); + expect(dayCompare.isEqualOrBetween(current, undefined, new Date(2022, 2, 16))).toBe(true); }); }); }); @@ -30,46 +30,46 @@ describe('CompareAdapter', () => { describe('isAfter', () => { it('should be true', () => { const current = new Date(2022, 2, 15); - expect(monthCompare.isAfter(current, new Date(2022, 1, 15))).toBeTrue(); + expect(monthCompare.isAfter(current, new Date(2022, 1, 15))).toBe(true); }); it('should be false', () => { const current = new Date(2022, 2, 15); - expect(monthCompare.isAfter(current, new Date(2022, 2, 14))).toBeFalse(); + expect(monthCompare.isAfter(current, new Date(2022, 2, 14))).toBe(false); }); }); describe('isBetween', () => { it('should be true', () => { const current = new Date(2022, 2, 15); - expect(monthCompare.isBetween(current)).toBeTrue(); - expect(monthCompare.isBetween(current, new Date(2022, 1, 20))).toBeTrue(); - expect(monthCompare.isBetween(current, undefined, new Date(2022, 3, 20))).toBeTrue(); - expect( - monthCompare.isBetween(current, new Date(2022, 1, 20), new Date(2022, 3, 20)) - ).toBeTrue(); + expect(monthCompare.isBetween(current)).toBe(true); + expect(monthCompare.isBetween(current, new Date(2022, 1, 20))).toBe(true); + expect(monthCompare.isBetween(current, undefined, new Date(2022, 3, 20))).toBe(true); + expect(monthCompare.isBetween(current, new Date(2022, 1, 20), new Date(2022, 3, 20))).toBe( + true + ); }); it('should be false', () => { const current = new Date(2022, 2, 15); - expect(monthCompare.isBetween(current, new Date(2022, 2, 20))).toBeFalse(); - expect(monthCompare.isBetween(current, undefined, new Date(2022, 2, 20))).toBeFalse(); - expect( - monthCompare.isBetween(current, new Date(2022, 2, 20), new Date(2022, 3, 20)) - ).toBeFalse(); + expect(monthCompare.isBetween(current, new Date(2022, 2, 20))).toBe(false); + expect(monthCompare.isBetween(current, undefined, new Date(2022, 2, 20))).toBe(false); + expect(monthCompare.isBetween(current, new Date(2022, 2, 20), new Date(2022, 3, 20))).toBe( + false + ); }); }); describe('isEqualOrBefore', () => { it('should be true', () => { const current = new Date(2022, 2, 15); - expect(monthCompare.isEqualOrBefore(current, new Date(2022, 2, 20))).toBeTrue(); - expect(monthCompare.isEqualOrBefore(current, new Date(2022, 3, 20))).toBeTrue(); + expect(monthCompare.isEqualOrBefore(current, new Date(2022, 2, 20))).toBe(true); + expect(monthCompare.isEqualOrBefore(current, new Date(2022, 3, 20))).toBe(true); }); it('should be false', () => { const current = new Date(2022, 2, 15); - expect(monthCompare.isEqualOrBefore(current, new Date(2022, 1, 20))).toBeFalse(); + expect(monthCompare.isEqualOrBefore(current, new Date(2022, 1, 20))).toBe(false); }); }); }); @@ -79,32 +79,32 @@ describe('CompareAdapter', () => { describe('isBetween', () => { it('should be true', () => { const current = new Date(2022, 2, 15); - expect(yearCompare.isBetween(current, new Date(2021, 2, 20))).toBeTrue(); - expect( - yearCompare.isBetween(current, new Date(2021, 2, 20), new Date(2023, 2, 20)) - ).toBeTrue(); + expect(yearCompare.isBetween(current, new Date(2021, 2, 20))).toBe(true); + expect(yearCompare.isBetween(current, new Date(2021, 2, 20), new Date(2023, 2, 20))).toBe( + true + ); }); it('should be false', () => { const current = new Date(2022, 2, 15); - expect(yearCompare.isBetween(current, undefined, new Date(2021, 2, 20))).toBeFalse(); - expect( - yearCompare.isBetween(current, new Date(2022, 2, 20), new Date(2022, 3, 20)) - ).toBeFalse(); + expect(yearCompare.isBetween(current, undefined, new Date(2021, 2, 20))).toBe(false); + expect(yearCompare.isBetween(current, new Date(2022, 2, 20), new Date(2022, 3, 20))).toBe( + false + ); }); }); describe('isEqualOrBefore', () => { it('should be true', () => { const current = new Date(2022, 2, 15); - expect(yearCompare.isEqualOrBefore(current, new Date(2022, 2, 20))).toBeTrue(); - expect(yearCompare.isEqualOrBefore(current, new Date(2023, 2, 20))).toBeTrue(); + expect(yearCompare.isEqualOrBefore(current, new Date(2022, 2, 20))).toBe(true); + expect(yearCompare.isEqualOrBefore(current, new Date(2023, 2, 20))).toBe(true); }); it('should be false', () => { const current = new Date(2022, 2, 15); - expect(yearCompare.isEqualOrBefore(current, new Date(2021, 2, 20))).toBeFalse(); - expect(yearCompare.isEqualOrBefore(current, undefined)).toBeFalse(); + expect(yearCompare.isEqualOrBefore(current, new Date(2021, 2, 20))).toBe(false); + expect(yearCompare.isEqualOrBefore(current, undefined)).toBe(false); }); }); }); diff --git a/projects/element-ng/datepicker/components/si-day-selection.component.spec.ts b/projects/element-ng/datepicker/components/si-day-selection.component.spec.ts index 13dc675b8..9f67b9a2a 100644 --- a/projects/element-ng/datepicker/components/si-day-selection.component.spec.ts +++ b/projects/element-ng/datepicker/components/si-day-selection.component.spec.ts @@ -167,7 +167,7 @@ describe('SiDaySelectionComponent', () => { const selectedElement = element.querySelector('.selected')!; expect(selectedElement.innerHTML.trim()).toBe('31'); - expect(isSameDate(wrapperComponent.focusedDate(), new Date('2022-03-31'))).toBeTrue(); + expect(isSameDate(wrapperComponent.focusedDate(), new Date('2022-03-31'))).toBe(true); }); it('should focus active date', () => { @@ -450,11 +450,11 @@ describe('SiDaySelectionComponent', () => { expect(pipeSpy).toHaveBeenCalledTimes(2); const month = pipeSpy.calls.argsFor(0); - expect(isSameMonth(month[0] as Date, today)).toBeTrue(); + expect(isSameMonth(month[0] as Date, today)).toBe(true); expect(month[1] as string).toBe('MMMM'); const year = pipeSpy.calls.argsFor(1); - expect(isSameYear(year[0] as Date, today)).toBeTrue(); + expect(isSameYear(year[0] as Date, today)).toBe(true); expect(year[1] as string).toBe('yyyy'); const activeCell = helper @@ -462,7 +462,7 @@ describe('SiDaySelectionComponent', () => { .querySelector('[cdkfocusinitial]') as HTMLElement; expect(activeCell).toBeTruthy(); expect(activeCell.innerHTML.trim()).toBe(today.getDate().toString()); - expect(isSameDate(wrapperComponent.focusedDate(), today)).toBeTrue(); + expect(isSameDate(wrapperComponent.focusedDate(), today)).toBe(true); }); it('should disable today button after click', async () => { @@ -502,7 +502,7 @@ describe('SiDaySelectionComponent', () => { .querySelector('[cdkfocusinitial]') as HTMLElement; expect(activeCell).toBeTruthy(); expect(activeCell.innerHTML.trim()).toBe(today.getDate().toString()); - expect(isSameDate(wrapperComponent.focusedDate(), today)).toBeTrue(); + expect(isSameDate(wrapperComponent.focusedDate(), today)).toBe(true); }); }); @@ -561,7 +561,7 @@ describe('SiDaySelectionComponent', () => { let selectedElements = helper.queryAsArray('.selected')!; expect(selectedElements.length).toBe(1); expect(selectedElements.at(-1)!.innerHTML.trim()).toBe('16'); - expect(isSameDate(rangeWrapperComponent.focusedDate(), new Date('2022-03-16'))).toBeTrue(); + expect(isSameDate(rangeWrapperComponent.focusedDate(), new Date('2022-03-16'))).toBe(true); selectDate(31); diff --git a/projects/element-ng/datepicker/components/si-month-selection.component.spec.ts b/projects/element-ng/datepicker/components/si-month-selection.component.spec.ts index 24433b3eb..b78a13c95 100644 --- a/projects/element-ng/datepicker/components/si-month-selection.component.spec.ts +++ b/projects/element-ng/datepicker/components/si-month-selection.component.spec.ts @@ -87,7 +87,7 @@ describe('SiMonthSelectionComponent', () => { it('should mark active date', () => { const expected = wrapperComponent.months().at(wrapperComponent.focusedDate().getMonth()); const activeCell = helper.getEnabledCellWithText(expected!); - expect(activeCell?.hasAttribute('cdkfocusinitial')).toBeTrue(); + expect(activeCell?.hasAttribute('cdkfocusinitial')).toBe(true); }); it('should focus active date', () => { @@ -208,7 +208,7 @@ describe('SiMonthSelectionComponent', () => { calendarBodyElement.dispatchEvent(generateKeyEvent('Escape')); fixture.detectChanges(); - expect(wrapperComponent.cancelled).toBeTrue(); + expect(wrapperComponent.cancelled).toBe(true); }); it('should decrement month on left arrow press', () => { diff --git a/projects/element-ng/datepicker/components/si-year-selection.component.spec.ts b/projects/element-ng/datepicker/components/si-year-selection.component.spec.ts index e9bb3596d..c0fed7398 100644 --- a/projects/element-ng/datepicker/components/si-year-selection.component.spec.ts +++ b/projects/element-ng/datepicker/components/si-year-selection.component.spec.ts @@ -73,7 +73,7 @@ describe('SiYearSelectionComponent', () => { it('should mark active date', () => { const activeCell = helper.getEnabledCellWithText('2022'); - expect(activeCell?.hasAttribute('cdkfocusinitial')).toBeTrue(); + expect(activeCell?.hasAttribute('cdkfocusinitial')).toBe(true); }); describe('with previous button', () => { @@ -170,7 +170,7 @@ describe('SiYearSelectionComponent', () => { calendarBodyElement.dispatchEvent(generateKeyEvent('Escape')); fixture.detectChanges(); - expect(wrapperComponent.cancelled).toBeTrue(); + expect(wrapperComponent.cancelled).toBe(true); }); it('should decrement year on left arrow press', () => { @@ -260,7 +260,7 @@ describe('SiYearSelectionComponent', () => { fixture.detectChanges(); const activeCell = helper.getEnabledCellWithText('2022'); - expect(activeCell?.hasAttribute('cdkfocusinitial')).toBeTrue(); + expect(activeCell?.hasAttribute('cdkfocusinitial')).toBe(true); }); }); }); @@ -285,7 +285,7 @@ describe('SiYearSelectionComponent', () => { fixture.detectChanges(); const activeCell = helper.getEnabledCellWithText('2022'); - expect(activeCell?.hasAttribute('cdkfocusinitial')).toBeTrue(); + expect(activeCell?.hasAttribute('cdkfocusinitial')).toBe(true); }); }); }); diff --git a/projects/element-ng/datepicker/date-time-helper.spec.ts b/projects/element-ng/datepicker/date-time-helper.spec.ts index 0d352d105..69af9bb83 100644 --- a/projects/element-ng/datepicker/date-time-helper.spec.ts +++ b/projects/element-ng/datepicker/date-time-helper.spec.ts @@ -118,7 +118,7 @@ describe('date time helper', () => { it('should not be the same object', () => { const input = new Date(Date.UTC(year, 0, 5)); const actual = addDays(input, 0); - expect(isSameDate(input, actual)).toBeTrue(); + expect(isSameDate(input, actual)).toBe(true); }); }); @@ -179,7 +179,7 @@ describe('date time helper', () => { it('should create new Date', () => { const actual = getWeekStartDate(input, 'monday'); - expect(input == actual).not.toBeTrue(); + expect(actual).not.toBe(input); }); it('should be monday', () => { @@ -217,7 +217,7 @@ describe('date time helper', () => { it('should create new Date', () => { const actual = getWeekEndDate(input, 'monday'); - expect(input == actual).not.toBeTrue(); + expect(actual).not.toBe(input); }); it('should be sunday', () => { diff --git a/projects/element-ng/datepicker/si-date-range.component.spec.ts b/projects/element-ng/datepicker/si-date-range.component.spec.ts index 7d481823c..0ba5b8da9 100644 --- a/projects/element-ng/datepicker/si-date-range.component.spec.ts +++ b/projects/element-ng/datepicker/si-date-range.component.spec.ts @@ -88,9 +88,9 @@ describe('SiDateRangeComponent', () => { openCalendarButton()!.click(); jasmine.clock().tick(0); await fixture.whenStable(); - expect(fixture.componentInstance.dateRange.touched).toBeFalse(); + expect(fixture.componentInstance.dateRange.touched).toBe(false); await backdropClick(fixture); - expect(fixture.componentInstance.dateRange.touched).toBeTrue(); + expect(fixture.componentInstance.dateRange.touched).toBe(true); }); it('should mark input as touched once the focused is moved outside', async () => { @@ -102,7 +102,7 @@ describe('SiDateRangeComponent', () => { await calendarButton.focus(); jasmine.clock().tick(1000); await fixture.whenStable(); - expect(fixture.componentInstance.dateRange.touched).toBeFalse(); + expect(fixture.componentInstance.dateRange.touched).toBe(false); await calendarButton.blur(); expect(fixture.componentInstance.dateRange.touched).toBeTruthy(); }); diff --git a/projects/element-ng/datepicker/si-datepicker.component.spec.ts b/projects/element-ng/datepicker/si-datepicker.component.spec.ts index 099f6a24d..bcd8c2d83 100644 --- a/projects/element-ng/datepicker/si-datepicker.component.spec.ts +++ b/projects/element-ng/datepicker/si-datepicker.component.spec.ts @@ -95,14 +95,14 @@ describe('SiDatepickerComponent', () => { const spy = spyOn(datePicker, 'toggleDisabledTime').and.callThrough(); const toggleTimeSwitch = await picker.considerTimeSwitch(); - expect(await toggleTimeSwitch.isChecked()).toBeTrue(); + expect(await toggleTimeSwitch.isChecked()).toBe(true); await toggleTimeSwitch.toggle(); expect(spy).toHaveBeenCalled(); - expect(component.config().disabledTime).toBeTrue(); + expect(component.config().disabledTime).toBe(true); await toggleTimeSwitch.toggle(); - expect(component.config().disabledTime).toBeFalse(); + expect(component.config().disabledTime).toBe(false); }); it('should update date when only time is changed in timepicker', async () => { @@ -140,15 +140,15 @@ describe('SiDatepickerComponent', () => { await fixture.whenStable(); const toggleTimeSwitch = await picker.considerTimeSwitch(); - expect(await toggleTimeSwitch.isChecked()).toBeTrue(); + expect(await toggleTimeSwitch.isChecked()).toBe(true); // Disable consider time await toggleTimeSwitch.toggle(); - expect(component.config().disabledTime).toBeTrue(); + expect(component.config().disabledTime).toBe(true); // Re-enable consider time await toggleTimeSwitch.toggle(); - expect(component.config().disabledTime).toBeFalse(); + expect(component.config().disabledTime).toBe(false); // Verify that the original time is restored expect(component.changedDate).toBeDefined(); diff --git a/projects/element-ng/datepicker/si-datepicker.directive.spec.ts b/projects/element-ng/datepicker/si-datepicker.directive.spec.ts index e79f82499..0f30aa656 100644 --- a/projects/element-ng/datepicker/si-datepicker.directive.spec.ts +++ b/projects/element-ng/datepicker/si-datepicker.directive.spec.ts @@ -225,9 +225,9 @@ describe('SiDatepickerDirective', () => { considerTime!.dispatchEvent(new Event('change')); await fixture.whenStable(); - expect(helper.getTimeInputHours().disabled).toBeTrue(); - expect(helper.getTimeInputMinutes().disabled).toBeTrue(); - expect(helper.getTimeInputSeconds().disabled).toBeTrue(); + expect(helper.getTimeInputHours().disabled).toBe(true); + expect(helper.getTimeInputMinutes().disabled).toBe(true); + expect(helper.getTimeInputSeconds().disabled).toBe(true); expect(disabledTime$).toHaveBeenCalledWith(true); }); }); diff --git a/projects/element-ng/datepicker/si-timepicker.component.spec.ts b/projects/element-ng/datepicker/si-timepicker.component.spec.ts index faa18e4b5..1008a452a 100644 --- a/projects/element-ng/datepicker/si-timepicker.component.spec.ts +++ b/projects/element-ng/datepicker/si-timepicker.component.spec.ts @@ -184,22 +184,22 @@ describe('SiTimepickerComponent', () => { component.time.setValue('2022-01-12 16:23:59.435'); fixture.detectChanges(); - expect(component.picker().isPM()).toBeTrue(); + expect(component.picker().isPM()).toBe(true); component.time.setValue('2022-01-12 04:23:59.435'); fixture.detectChanges(); - expect(component.picker().isPM()).toBeFalse(); + expect(component.picker().isPM()).toBe(false); }); it('should falsify isPM when meridian is hidden', () => { fixture.detectChanges(); component.time.setValue('2022-01-12 16:23:59.435'); fixture.detectChanges(); - expect(component.picker().isPM()).toBeTrue(); + expect(component.picker().isPM()).toBe(true); component.showMeridian.set(false); fixture.detectChanges(); - expect(component.picker().isPM()).toBeFalse(); + expect(component.picker().isPM()).toBe(false); }); it('should validate hours range', () => { diff --git a/projects/element-ng/electron-titlebar/si-electron-titlebar.component.spec.ts b/projects/element-ng/electron-titlebar/si-electron-titlebar.component.spec.ts index 4b0231b8d..a8ea346db 100644 --- a/projects/element-ng/electron-titlebar/si-electron-titlebar.component.spec.ts +++ b/projects/element-ng/electron-titlebar/si-electron-titlebar.component.spec.ts @@ -75,8 +75,8 @@ describe('SiElectrontitlebarComponent', () => { const disabledButtons = fixture.nativeElement.querySelectorAll('button:disabled'); expect(disabledButtons.length).toEqual(2); - expect(forwardButton().disabled).toBeTrue(); - expect(backButton().disabled).toBeTrue(); + expect(forwardButton().disabled).toBe(true); + expect(backButton().disabled).toBe(true); fixture.detectChanges(); }); diff --git a/projects/element-ng/file-uploader/si-file-uploader.component.spec.ts b/projects/element-ng/file-uploader/si-file-uploader.component.spec.ts index 0e3976eaf..fae4255f6 100644 --- a/projects/element-ng/file-uploader/si-file-uploader.component.spec.ts +++ b/projects/element-ng/file-uploader/si-file-uploader.component.spec.ts @@ -385,7 +385,7 @@ describe('SiFileUploaderComponent', () => { req.flush(attachment); httpMock.verify(); - expect(req.request.body.has(component.uploadConfig.fieldName)).toBeTrue(); + expect(req.request.body.has(component.uploadConfig.fieldName)).toBe(true); }); it('should upload file as binary', () => { @@ -400,7 +400,7 @@ describe('SiFileUploaderComponent', () => { req.flush(attachment); httpMock.verify(); - expect(req.request.body instanceof Blob).toBeTrue(); + expect(req.request.body instanceof Blob).toBe(true); }); it('should upload file with additional fields', () => { @@ -511,7 +511,7 @@ describe('SiFileUploaderComponent', () => { fixture.detectChanges(); const req = httpMock.expectOne('/api/attachments'); - expect(req.cancelled).toBeTrue(); + expect(req.cancelled).toBe(true); expect(canceledSpy).toHaveBeenCalledWith( jasmine.objectContaining({ fileName: 'matching.fmwr', size: '4B', status: 'added' }) ); diff --git a/projects/element-ng/filter-bar/si-filter-bar.component.spec.ts b/projects/element-ng/filter-bar/si-filter-bar.component.spec.ts index 86479dbfc..0369ea60b 100644 --- a/projects/element-ng/filter-bar/si-filter-bar.component.spec.ts +++ b/projects/element-ng/filter-bar/si-filter-bar.component.spec.ts @@ -126,7 +126,7 @@ describe('SiFilterBarComponent', () => { const resetButton = element.querySelector('button') as HTMLButtonElement; - expect(resetButton?.disabled).toBeTrue(); + expect(resetButton?.disabled).toBe(true); }); it('should show empty indicator when no filters are active', () => { diff --git a/projects/element-ng/filtered-search/si-filtered-search.component.spec.ts b/projects/element-ng/filtered-search/si-filtered-search.component.spec.ts index e8e968246..e1e6b2362 100644 --- a/projects/element-ng/filtered-search/si-filtered-search.component.spec.ts +++ b/projects/element-ng/filtered-search/si-filtered-search.component.spec.ts @@ -354,7 +354,7 @@ describe('SiFilteredSearchComponent', () => { await criterionValue?.focus(); await criterionValue?.select({ text: 'first' }); await tick(); - expect(await freeTextSearch.isFocused()).toBeTrue(); + expect(await freeTextSearch.isFocused()).toBe(true); await criterionValue?.click(); expect(await criterionValue?.getValue()).toEqual('first'); @@ -632,14 +632,14 @@ describe('SiFilteredSearchComponent', () => { await criterionValue?.sendKeys(TestKey.ENTER); await tick(); const operator2 = await criteria[1].operator(); - expect(await operator2!.hasFocs()).toBeTrue(); + expect(await operator2!.hasFocs()).toBe(true); await operator2!.sendKeys(TestKey.ENTER); const value2 = await criteria[1].value(); - expect(await value2!.hasFocs()).toBeTrue(); + expect(await value2!.hasFocs()).toBe(true); await value2!.sendKeys(TestKey.ENTER); expect( await filteredSearch.freeTextSearch().then(freeTextSearch => freeTextSearch.isFocused()) - ).toBeTrue(); + ).toBe(true); }); it('should be able to enter date with keyboard', async () => { @@ -690,11 +690,11 @@ describe('SiFilteredSearchComponent', () => { await datepicker!.next(); await datepicker!.selectCell({ text: '13' }); await criterionValue.sendKeys(TestKey.ESCAPE); - expect(await criterionValue.isEditable()).toBeTrue(); + expect(await criterionValue.isEditable()).toBe(true); expect(await criterionValue.getValue()).toBe('9/13/1999'); await criterionValue.blur(); await tick(); - expect(await criterionValue.isEditable()).toBeFalse(); + expect(await criterionValue.isEditable()).toBe(false); expect(await criterionValue.text()).toBe('9/13/1999'); }); }); @@ -1052,7 +1052,7 @@ describe('SiFilteredSearchComponent', () => { const criterionValue = (await criterion.value())!; expect(await criterionValue.getItems({ isSelected: false })).toHaveSize(2); await criterion.clickClearButton(); - expect(await criterionValue.hasFocs()).toBeTrue(); + expect(await criterionValue.hasFocs()).toBe(true); expect(await criterionValue.getItems({ isSelected: false })).toHaveSize(4); expect(component.filteredSearch().searchCriteria()).toEqual({ @@ -1496,7 +1496,7 @@ describe('SiFilteredSearchComponent', () => { await tick(); await operator?.select({ text: '<' }); await tick(); - expect(await criteria[0].value().then(value => value?.hasFocs())).toBeTrue(); + expect(await criteria[0].value().then(value => value?.hasFocs())).toBe(true); expect(component.doSearch).toHaveBeenCalledWith({ criteria: [ @@ -1710,7 +1710,7 @@ describe('SiFilteredSearchComponent', () => { await criteriaValue?.sendKeys(';'); expect( await filteredSearch.freeTextSearch().then(freeTextSearch => freeTextSearch.isFocused()) - ).toBeTrue(); + ).toBe(true); }); it('should focus value field after keyboard Enter (operator field)', async () => { @@ -1735,7 +1735,7 @@ describe('SiFilteredSearchComponent', () => { await operator?.focus(); // Skip test when browser is not focussed to prevent failures. await operator?.sendKeys(TestKey.ENTER); - expect(await criteria[0].value().then(value => value?.hasFocs())).toBeTrue(); + expect(await criteria[0].value().then(value => value?.hasFocs())).toBe(true); }); it('should focus operator if backspace pressed in empty criterion value', async () => { @@ -1758,7 +1758,7 @@ describe('SiFilteredSearchComponent', () => { await value!.click(); await value!.setValue(''); await value!.sendKeys(TestKey.BACKSPACE); - expect(await criteria[0].operator().then(operator => operator?.hasFocs())).toBeTrue(); + expect(await criteria[0].operator().then(operator => operator?.hasFocs())).toBe(true); }); it('should delete criterion if backspace pressed in empty criterion value without operator', async () => { @@ -1780,11 +1780,11 @@ describe('SiFilteredSearchComponent', () => { .getCriteria({ labelText: 'second' }) .then(criteria => criteria[0].value()); await tick(); - expect(await value2!.hasFocs()).toBeTrue(); + expect(await value2!.hasFocs()).toBe(true); await value2!.sendKeys(TestKey.BACKSPACE); expect( await filteredSearch.freeTextSearch().then(freeTextSearch => freeTextSearch.isFocused()) - ).toBeTrue(); + ).toBe(true); expect(await filteredSearch.getCriteria()).toHaveSize(0); }); @@ -1823,7 +1823,7 @@ describe('SiFilteredSearchComponent', () => { await freeTextSearch.sendKeys(TestKey.BACKSPACE); const criteria = await filteredSearch.getCriteria({ labelText: 'location' }); await tick(); - expect(await criteria[0].value().then(value => value?.hasFocs())).toBeTrue(); + expect(await criteria[0].value().then(value => value?.hasFocs())).toBe(true); }); it('should match criterion label after keyboard colon was pressed', async () => { diff --git a/projects/element-ng/form/si-form-container/si-form-container.component.spec.ts b/projects/element-ng/form/si-form-container/si-form-container.component.spec.ts index 0f276f975..110bdfff3 100644 --- a/projects/element-ng/form/si-form-container/si-form-container.component.spec.ts +++ b/projects/element-ng/form/si-form-container/si-form-container.component.spec.ts @@ -99,65 +99,65 @@ describe('SiFormContainerComponent', () => { component.form = undefined; component.cdRef.markForCheck(); fixture.detectChanges(); - expect(formContainer.userInteractedWithForm).toBeFalse(); + expect(formContainer.userInteractedWithForm).toBe(false); }); it('shall return true with touched control', () => { - expect(formContainer.userInteractedWithForm).toBeFalse(); - expect(formContainer.userInteractedWithForm).toBeFalse(); + expect(formContainer.userInteractedWithForm).toBe(false); + expect(formContainer.userInteractedWithForm).toBe(false); component.form!.controls.name.markAsTouched(); - expect(formContainer.userInteractedWithForm).toBeTrue(); + expect(formContainer.userInteractedWithForm).toBe(true); }); it('shall return true with dirty control', () => { - expect(formContainer.userInteractedWithForm).toBeFalse(); - expect(formContainer.userInteractedWithForm).toBeFalse(); + expect(formContainer.userInteractedWithForm).toBe(false); + expect(formContainer.userInteractedWithForm).toBe(false); component.form!.controls.name.markAsDirty(); - expect(formContainer.userInteractedWithForm).toBeTrue(); + expect(formContainer.userInteractedWithForm).toBe(true); }); }); describe('validFormContainerMessage', () => { it('shall return false with valid form and no user interaction', () => { component.form!.setValue({ name: 'Peter', email: 'peter@samlple.com' }); - expect(formContainer.validFormContainerMessage).toBeFalse(); + expect(formContainer.validFormContainerMessage).toBe(false); }); it('shall return false with invalid form and no user interaction', () => { - expect(formContainer.validFormContainerMessage).toBeFalse(); + expect(formContainer.validFormContainerMessage).toBe(false); }); it('shall return true with valid form and user interaction', () => { component.form!.setValue({ name: 'Peter', email: 'peter@samlple.com' }); component.form!.controls.name.markAsTouched(); - expect(formContainer.validFormContainerMessage).toBeTrue(); + expect(formContainer.validFormContainerMessage).toBe(true); }); it('shall return false with invalid form and user interaction', () => { component.form!.controls.name.markAsTouched(); - expect(formContainer.validFormContainerMessage).toBeFalse(); + expect(formContainer.validFormContainerMessage).toBe(false); }); }); describe('invalidFormContainerMessage', () => { it('shall return false with valid form and no user interaction', () => { component.form!.setValue({ name: 'Peter', email: 'peter@samlple.com' }); - expect(formContainer.invalidFormContainerMessage).toBeFalse(); + expect(formContainer.invalidFormContainerMessage).toBe(false); }); it('shall return false with invalid form and no user interaction', () => { - expect(formContainer.invalidFormContainerMessage).toBeFalse(); + expect(formContainer.invalidFormContainerMessage).toBe(false); }); it('shall return false with valid form and user interaction', () => { component.form!.setValue({ name: 'Peter', email: 'peter@samlple.com' }); - expect(formContainer.invalidFormContainerMessage).toBeFalse(); + expect(formContainer.invalidFormContainerMessage).toBe(false); component.form!.controls.name.markAsTouched(); - expect(formContainer.invalidFormContainerMessage).toBeFalse(); + expect(formContainer.invalidFormContainerMessage).toBe(false); }); it('shall return true with invalid form and user interaction', () => { component.form!.controls.name.markAsTouched(); - expect(formContainer.invalidFormContainerMessage).toBeTrue(); + expect(formContainer.invalidFormContainerMessage).toBe(true); }); }); }); diff --git a/projects/element-ng/form/si-form.spec.ts b/projects/element-ng/form/si-form.spec.ts index 863ab8ae0..c40f2afe1 100644 --- a/projects/element-ng/form/si-form.spec.ts +++ b/projects/element-ng/form/si-form.spec.ts @@ -139,11 +139,11 @@ describe('SiForm', () => { it('should only have a required indicator on the fieldset', async () => { fixture.componentInstance.form.markAllAsTouched(); const field1 = await loader.getHarness(SiFormItemHarness.with({ label: 'Radio-1' })); - expect(await field1.isRequired()).toBeFalse(); + expect(await field1.isRequired()).toBe(false); const field2 = await loader.getHarness(SiFormItemHarness.with({ label: 'Radio-2' })); - expect(await field2.isRequired()).toBeFalse(); + expect(await field2.isRequired()).toBe(false); const fieldset = await loader.getHarness(SiFormFieldsetHarness.with('Fieldset-RADIO')); - expect(await fieldset.isRequired()).toBeTrue(); + expect(await fieldset.isRequired()).toBe(true); }); }); @@ -184,7 +184,7 @@ describe('SiForm', () => { it('should have a required indicator', async () => { const field = await loader.getHarness(SiFormItemHarness.with({ label: 'Input' })); - expect(await field.isRequired()).toBeTrue(); + expect(await field.isRequired()).toBe(true); }); it('should update required indicator', async () => { @@ -192,7 +192,7 @@ describe('SiForm', () => { fixture.changeDetectorRef.markForCheck(); await fixture.whenStable(); const field = await loader.getHarness(SiFormItemHarness.with({ label: 'Input' })); - expect(await field.isRequired()).toBeFalse(); + expect(await field.isRequired()).toBe(false); }); }); @@ -226,11 +226,11 @@ describe('SiForm', () => { it('should update required indicator', async () => { const field = await loader.getHarness(SiFormItemHarness.with({ label: 'Input' })); - expect(await field.isRequired()).toBeTrue(); + expect(await field.isRequired()).toBe(true); fixture.componentInstance.required = false; fixture.changeDetectorRef.markForCheck(); await fixture.whenStable(); - expect(await field.isRequired()).toBeFalse(); + expect(await field.isRequired()).toBe(false); }); }); diff --git a/projects/element-ng/formly/fields/time/si-formly-time.component.spec.ts b/projects/element-ng/formly/fields/time/si-formly-time.component.spec.ts index 710cbff28..72520e078 100644 --- a/projects/element-ng/formly/fields/time/si-formly-time.component.spec.ts +++ b/projects/element-ng/formly/fields/time/si-formly-time.component.spec.ts @@ -66,7 +66,7 @@ describe('formly time-type', () => { const debugEl = fixture.debugElement.query(By.directive(SiTimepickerComponent)); const instance = debugEl.componentInstance as SiTimepickerComponent; - expect(instance.hideLabels()).toBeTrue(); + expect(instance.hideLabels()).toBe(true); }); it('should set timepicker to readonly', () => { @@ -88,7 +88,7 @@ describe('formly time-type', () => { const debugEl = fixture.debugElement.query(By.directive(SiTimepickerComponent)); const instance = debugEl.componentInstance as SiTimepickerComponent; - expect(instance.readonly()).toBeTrue(); + expect(instance.readonly()).toBe(true); }); it('should set timepicker hideLabels to false', () => { @@ -107,7 +107,7 @@ describe('formly time-type', () => { const debugEl = fixture.debugElement.query(By.directive(SiTimepickerComponent)); const instance = debugEl.componentInstance as SiTimepickerComponent; - expect(instance.hideLabels()).toBeFalse(); + expect(instance.hideLabels()).toBe(false); }); it('should not use the padding-inline-end or class .form-control-has-icon', () => { @@ -148,7 +148,7 @@ describe('formly time-type', () => { const debugEl = fixture.debugElement.query(By.directive(SiTimepickerComponent)); const instance = debugEl.componentInstance as SiTimepickerComponent; - expect(instance.showMinutes()).toBeFalse(); + expect(instance.showMinutes()).toBe(false); }); it('should set timepicker showSeconds to true', () => { @@ -168,7 +168,7 @@ describe('formly time-type', () => { const debugEl = fixture.debugElement.query(By.directive(SiTimepickerComponent)); const instance = debugEl.componentInstance as SiTimepickerComponent; - expect(instance.showSeconds()).toBeTrue(); + expect(instance.showSeconds()).toBe(true); }); it('should set timepicker showSeconds to true', () => { @@ -188,7 +188,7 @@ describe('formly time-type', () => { const debugEl = fixture.debugElement.query(By.directive(SiTimepickerComponent)); const instance = debugEl.componentInstance as SiTimepickerComponent; - expect(instance.showMilliseconds()).toBeTrue(); + expect(instance.showMilliseconds()).toBe(true); }); it(`should set timepicker show meridian`, () => { @@ -208,7 +208,7 @@ describe('formly time-type', () => { const debugEl = fixture.debugElement.query(By.directive(SiTimepickerComponent)); const instance = debugEl.componentInstance as SiTimepickerComponent; - expect(instance.showMeridian()).toBeTrue(); + expect(instance.showMeridian()).toBe(true); }); it(`should support date string value input`, () => { diff --git a/projects/element-ng/formly/si-formly-translate.extension.spec.ts b/projects/element-ng/formly/si-formly-translate.extension.spec.ts index 9b4acb427..d930847a1 100644 --- a/projects/element-ng/formly/si-formly-translate.extension.spec.ts +++ b/projects/element-ng/formly/si-formly-translate.extension.spec.ts @@ -72,7 +72,7 @@ describe('Formly translations', () => { } }; extension.prePopulate(cfg); - expect(cfg.props?.['_translated']).toBeTrue(); //eslint-disable-line @typescript-eslint/dot-notation + expect(cfg.props?.['_translated']).toBe(true); //eslint-disable-line @typescript-eslint/dot-notation }); it('should translate a label', () => { diff --git a/projects/element-ng/formly/structural/si-formly-accordion/si-formly-accordion.component.spec.ts b/projects/element-ng/formly/structural/si-formly-accordion/si-formly-accordion.component.spec.ts index 7ee450b2e..cebfcb1b4 100644 --- a/projects/element-ng/formly/structural/si-formly-accordion/si-formly-accordion.component.spec.ts +++ b/projects/element-ng/formly/structural/si-formly-accordion/si-formly-accordion.component.spec.ts @@ -125,7 +125,7 @@ describe('formly accordion type', () => { // check if default is open if (fieldGroups) { - expect(fieldGroups[0].props?.opened).toBeTrue(); + expect(fieldGroups[0].props?.opened).toBe(true); } clickOnHeader(1, fixture.nativeElement); @@ -133,8 +133,8 @@ describe('formly accordion type', () => { // check if property changes when clicking on panel if (fieldGroups) { - expect(fieldGroups[0].props?.opened).toBeFalse(); - expect(fieldGroups[1].props?.opened).toBeTrue(); + expect(fieldGroups[0].props?.opened).toBe(false); + expect(fieldGroups[1].props?.opened).toBe(true); } }); }); diff --git a/projects/element-ng/header-dropdown/si-header-dropdown.directive.spec.ts b/projects/element-ng/header-dropdown/si-header-dropdown.directive.spec.ts index cabb75e91..951991abb 100644 --- a/projects/element-ng/header-dropdown/si-header-dropdown.directive.spec.ts +++ b/projects/element-ng/header-dropdown/si-header-dropdown.directive.spec.ts @@ -63,8 +63,8 @@ describe('SiHeaderDropdown', () => { it('should open overlay', async () => { await trigger1Harness.toggle(); - expect(await trigger1Harness.isOpen()).toBeTrue(); - expect(await trigger1Harness.isDesktop()).toBeTrue(); + expect(await trigger1Harness.isOpen()).toBe(true); + expect(await trigger1Harness.isDesktop()).toBe(true); }); it('should close all on outside click', async () => { @@ -74,9 +74,9 @@ describe('SiHeaderDropdown', () => { .then(dropdown => dropdown.getTrigger('Item 1-2')); await trigger2Harness.toggle(); - expect(await trigger2Harness.isOpen()).toBeTrue(); + expect(await trigger2Harness.isOpen()).toBe(true); document.getElementById('outside-button')!.click(); - expect(await trigger1Harness.isOpen()).toBeFalse(); + expect(await trigger1Harness.isOpen()).toBe(false); }); it('should close only current on toggle click', async () => { @@ -85,18 +85,18 @@ describe('SiHeaderDropdown', () => { const trigger2Harness = await dropdown1.getTrigger('Item 1-2'); await trigger2Harness.toggle(); - expect(await trigger2Harness.isOpen()).toBeTrue(); + expect(await trigger2Harness.isOpen()).toBe(true); await trigger2Harness.toggle(); - expect(await trigger2Harness.isOpen()).toBeFalse(); - expect(await dropdown1.isOpen()).toBeTrue(); + expect(await trigger2Harness.isOpen()).toBe(false); + expect(await dropdown1.isOpen()).toBe(true); }); it('should close on resize', async () => { await trigger1Harness.toggle(); - expect(await trigger1Harness.isOpen()).toBeTrue(); + expect(await trigger1Harness.isOpen()).toBe(true); fixture.componentInstance.inlineDropdown.next(false); - expect(await trigger1Harness.isOpen()).toBeFalse(); + expect(await trigger1Harness.isOpen()).toBe(false); }); it('should close on item click', async () => { @@ -106,7 +106,7 @@ describe('SiHeaderDropdown', () => { .then(dropdown => dropdown.getItem('Item 1-1')) .then(item => item.click()); - expect(await trigger1Harness.isOpen()).toBeFalse(); + expect(await trigger1Harness.isOpen()).toBe(false); }); it('should emit only once on close', async () => { @@ -132,8 +132,8 @@ describe('SiHeaderDropdown', () => { it('should open inline in mobile view', async () => { await trigger1Harness.toggle(); - expect(await trigger1Harness.isOpen()).toBeTrue(); - expect(await trigger1Harness.isDesktop()).toBeFalse(); + expect(await trigger1Harness.isOpen()).toBe(true); + expect(await trigger1Harness.isDesktop()).toBe(false); }); it('should close only current on toggle click', async () => { @@ -142,18 +142,18 @@ describe('SiHeaderDropdown', () => { const trigger2Harness = await dropdown1.getTrigger('Item 1-2'); await trigger2Harness.toggle(); - expect(await trigger2Harness.isOpen()).toBeTrue(); + expect(await trigger2Harness.isOpen()).toBe(true); await trigger2Harness.toggle(); - expect(await trigger2Harness.isOpen()).toBeFalse(); - expect(await dropdown1.isOpen()).toBeTrue(); + expect(await trigger2Harness.isOpen()).toBe(false); + expect(await dropdown1.isOpen()).toBe(true); }); it('should close on resize', async () => { await trigger1Harness.toggle(); - expect(await trigger1Harness.isOpen()).toBeTrue(); + expect(await trigger1Harness.isOpen()).toBe(true); fixture.componentInstance.inlineDropdown.next(true); - expect(await trigger1Harness.isOpen()).toBeFalse(); + expect(await trigger1Harness.isOpen()).toBe(false); }); it('should close on item click', async () => { @@ -163,7 +163,7 @@ describe('SiHeaderDropdown', () => { .then(dropdown => dropdown.getItem('Item 1-1')) .then(item => item.click()); - expect(await trigger1Harness.isOpen()).toBeFalse(); + expect(await trigger1Harness.isOpen()).toBe(false); }); }); }); diff --git a/projects/element-ng/landing-page/change-password/si-change-password.component.spec.ts b/projects/element-ng/landing-page/change-password/si-change-password.component.spec.ts index 523ad406a..9a628147a 100644 --- a/projects/element-ng/landing-page/change-password/si-change-password.component.spec.ts +++ b/projects/element-ng/landing-page/change-password/si-change-password.component.spec.ts @@ -93,7 +93,7 @@ describe('SiChangePasswordComponent', () => { fixture.detectChanges(); const changeButton = fixture.nativeElement.querySelector('button[type="submit"].btn-primary'); - expect(changeButton.disabled).toBeTrue(); + expect(changeButton.disabled).toBe(true); }); it('should emit back event on back button click and reset the form', () => { diff --git a/projects/element-ng/landing-page/explicit-legal-acknowledge/si-explicit-legal-acknowledge.component.spec.ts b/projects/element-ng/landing-page/explicit-legal-acknowledge/si-explicit-legal-acknowledge.component.spec.ts index 200c41797..e091c77c0 100644 --- a/projects/element-ng/landing-page/explicit-legal-acknowledge/si-explicit-legal-acknowledge.component.spec.ts +++ b/projects/element-ng/landing-page/explicit-legal-acknowledge/si-explicit-legal-acknowledge.component.spec.ts @@ -40,7 +40,7 @@ describe('SiExplicitLegalAcknowledgeComponent', () => { fixture.detectChanges(); const acceptButton = fixture.nativeElement.querySelector('button[type="button"].btn-primary'); - expect(acceptButton.disabled).toBeTrue(); + expect(acceptButton.disabled).toBe(true); }); it('should emit back event when the back button is clicked', () => { diff --git a/projects/element-ng/landing-page/login-single-sign-on/si-login-single-sign-on.component.spec.ts b/projects/element-ng/landing-page/login-single-sign-on/si-login-single-sign-on.component.spec.ts index 670a74a66..6b3b46046 100644 --- a/projects/element-ng/landing-page/login-single-sign-on/si-login-single-sign-on.component.spec.ts +++ b/projects/element-ng/landing-page/login-single-sign-on/si-login-single-sign-on.component.spec.ts @@ -34,6 +34,6 @@ describe('SiLoginSingleSignOnComponent', () => { component.setInput('disableSso', true); fixture.detectChanges(); const button = fixture.nativeElement.querySelector('button'); - expect(button.disabled).toBeTrue(); + expect(button.disabled).toBe(true); }); }); diff --git a/projects/element-ng/list-details/si-list-details.component.spec.ts b/projects/element-ng/list-details/si-list-details.component.spec.ts index 7978248d2..b535f5c35 100644 --- a/projects/element-ng/list-details/si-list-details.component.spec.ts +++ b/projects/element-ng/list-details/si-list-details.component.spec.ts @@ -211,7 +211,7 @@ describe('ListDetailsComponent', () => { const backButton = htmlElement.querySelector('si-details-pane button')!; backButton.dispatchEvent(new Event('click')); fixture.detectChanges(); - expect(component.detailsActive).toBeFalse(); + expect(component.detailsActive).toBe(false); }); it('should add host .expanded class when crossing expandBreakpoint', () => { @@ -249,7 +249,7 @@ describe('ListDetailsComponent', () => { it('should change hasLargeSize to true when crossing above breakpoint', async () => { await fixture.whenStable(); fixture.detectChanges(); - expect(component.listDetails.hasLargeSize()).toBeTrue(); + expect(component.listDetails.hasLargeSize()).toBe(true); }); it('should change hasLargeSize to false when dropping below breakpoint', async () => { @@ -258,7 +258,7 @@ describe('ListDetailsComponent', () => { resizeObserver.next({ width: component.expandBreakpoint - 1, height: 500 }); await fixture.whenStable(); fixture.detectChanges(); - expect(component.listDetails.hasLargeSize()).toBeFalse(); + expect(component.listDetails.hasLargeSize()).toBe(false); }); }); @@ -274,15 +274,15 @@ describe('ListDetailsComponent', () => { await fixture.whenStable(); fixture.detectChanges(); - expect(getInViewport(getDetailsPane().firstElementChild as HTMLElement)).toBeTrue(); + expect(getInViewport(getDetailsPane().firstElementChild as HTMLElement)).toBe(true); const backBtn = htmlElement.querySelector('si-details-pane button')!; backBtn.dispatchEvent(new Event('click')); fixture.detectChanges(); await fixture.whenStable(); - expect(component.detailsActive).toBeFalse(); - expect(getInViewport(getListPane().firstElementChild as HTMLElement)).toBeTrue(); + expect(component.detailsActive).toBe(false); + expect(getInViewport(getListPane().firstElementChild as HTMLElement)).toBe(true); }); it('should switch between split and static layouts as size & disableResizing change', async () => { @@ -312,14 +312,14 @@ describe('ListDetailsComponent', () => { component.detailsActive = false; fixture.detectChanges(); await fixture.whenStable(); - expect(getInViewport(getListPane().firstElementChild as HTMLElement)).toBeTrue(); - expect(getInViewport(getDetailsPane().firstElementChild as HTMLElement)).toBeTrue(); + expect(getInViewport(getListPane().firstElementChild as HTMLElement)).toBe(true); + expect(getInViewport(getDetailsPane().firstElementChild as HTMLElement)).toBe(true); component.detailsActive = true; fixture.detectChanges(); await fixture.whenStable(); - expect(getInViewport(getListPane().firstElementChild as HTMLElement)).toBeTrue(); - expect(getInViewport(getDetailsPane().firstElementChild as HTMLElement)).toBeTrue(); + expect(getInViewport(getListPane().firstElementChild as HTMLElement)).toBe(true); + expect(getInViewport(getDetailsPane().firstElementChild as HTMLElement)).toBe(true); }); }); @@ -356,7 +356,7 @@ describe('ListDetailsComponent', () => { component.detailsActive = false; fixture.detectChanges(); await fixture.whenStable(); - expect(getInViewport(getDetailsPane().firstElementChild as HTMLElement)).toBeFalse(); + expect(getInViewport(getDetailsPane().firstElementChild as HTMLElement)).toBe(false); }); it('should set inert attribute to prevent focus on hidden details when details are inactive on small screens', async () => { @@ -381,7 +381,7 @@ describe('ListDetailsComponent', () => { fixture.detectChanges(); htmlElement.querySelector('button')?.click(); fixture.detectChanges(); - expect(component.detailsActive).toBeFalse(); + expect(component.detailsActive).toBe(false); }); it('should not show details back button when hideBackButton is true', () => { @@ -396,7 +396,7 @@ describe('ListDetailsComponent', () => { component.detailsActive = true; fixture.detectChanges(); await fixture.whenStable(); - expect(getInViewport(getListPane().firstElementChild as HTMLElement)).toBeFalse(); + expect(getInViewport(getListPane().firstElementChild as HTMLElement)).toBe(false); }); }); }); @@ -483,7 +483,7 @@ describe('ListDetailsComponent', () => { await routerHarness.navigateByUrl('/list/details'); routerHarness.detectChanges(); expect(debugElement.query(By.css('si-details-pane-body'))).toBeTruthy(); - expect(debugElement.query(By.css('.list-details')).classes['details-active']).toBeTrue(); + expect(debugElement.query(By.css('.list-details')).classes['details-active']).toBe(true); debugElement.query(By.css('.si-details-header-back')).nativeElement.click(); routerHarness.detectChanges(); await routerHarness.fixture.whenStable(); @@ -504,7 +504,7 @@ describe('ListDetailsComponent', () => { await routerHarness.navigateByUrl('/list/details'); routerHarness.detectChanges(); expect(debugElement.query(By.css('si-details-pane-body'))).toBeTruthy(); - expect(debugElement.query(By.css('.list-details')).classes['details-active']).toBeTrue(); + expect(debugElement.query(By.css('.list-details')).classes['details-active']).toBe(true); await routerHarness.navigateByUrl('/list'); routerHarness.detectChanges(); await routerHarness.fixture.whenStable(); diff --git a/projects/element-ng/loading-spinner/si-loading-spinner.directive.spec.ts b/projects/element-ng/loading-spinner/si-loading-spinner.directive.spec.ts index 4e5c2c22d..72b59168e 100644 --- a/projects/element-ng/loading-spinner/si-loading-spinner.directive.spec.ts +++ b/projects/element-ng/loading-spinner/si-loading-spinner.directive.spec.ts @@ -54,28 +54,28 @@ describe('SiLoadingSpinnerDirective', () => { fixture.detectChanges(); jasmine.clock().tick(initialDelay - 10); await fixture.whenStable(); - expect(isLoading()).toBeFalse(); + expect(isLoading()).toBe(false); }); it('should display spinner after initial delay', async () => { await fixture.whenStable(); jasmine.clock().tick(initialDelay); await fixture.whenStable(); - expect(isLoading()).toBeTrue(); + expect(isLoading()).toBe(true); }); it('should skip showing spinner if canceled before initial delay', async () => { await fixture.whenStable(); jasmine.clock().tick(initialDelay - 10); await fixture.whenStable(); - expect(isLoading()).toBeFalse(); + expect(isLoading()).toBe(false); fixture.componentInstance.loading = false; fixture.changeDetectorRef.markForCheck(); jasmine.clock().tick(600); await fixture.whenStable(); - expect(isLoading()).toBeFalse(); + expect(isLoading()).toBe(false); }); it('should show and hide spinner', async () => { @@ -83,7 +83,7 @@ describe('SiLoadingSpinnerDirective', () => { await fixture.whenStable(); jasmine.clock().tick(initialDelay); await fixture.whenStable(); - expect(isLoading()).toBeTrue(); + expect(isLoading()).toBe(true); fixture.componentInstance.loading = false; fixture.changeDetectorRef.markForCheck(); @@ -93,6 +93,6 @@ describe('SiLoadingSpinnerDirective', () => { jasmine.clock().tick(0); await fixture.whenStable(); - expect(isLoading()).toBeFalse(); + expect(isLoading()).toBe(false); }); }); diff --git a/projects/element-ng/localization/si-locale-store.spec.ts b/projects/element-ng/localization/si-locale-store.spec.ts index 4baaa5839..5fa39c814 100644 --- a/projects/element-ng/localization/si-locale-store.spec.ts +++ b/projects/element-ng/localization/si-locale-store.spec.ts @@ -19,7 +19,7 @@ describe('SiDefaultLocaleStore', () => { it('should return a saved locale', async () => { const store = new SiDefaultLocaleStore(true); const saveSucceed = await firstValueFrom(store.saveLocale('en')); - expect(saveSucceed).toBeTrue(); + expect(saveSucceed).toBe(true); const store2 = new SiDefaultLocaleStore(true); expect(store2.locale).toBe('en'); }); diff --git a/projects/element-ng/localization/si-locale.service.spec.ts b/projects/element-ng/localization/si-locale.service.spec.ts index 053f92225..a0d1bf3a9 100644 --- a/projects/element-ng/localization/si-locale.service.spec.ts +++ b/projects/element-ng/localization/si-locale.service.spec.ts @@ -55,8 +55,8 @@ describe('SiLocaleService', () => { expect(service.config.availableLocales!.length).toBe(1); expect(service.config.availableLocales![0]).toBe('en'); expect(service.config.defaultLocale).toBe('en'); - expect(service.config.dynamicLanguageChange).toBeFalse(); - expect(service.config.fallbackEnabled).toBeFalse(); + expect(service.config.dynamicLanguageChange).toBe(false); + expect(service.config.fallbackEnabled).toBe(false); expect(service.config.localeInitializer).toBeDefined(); }); @@ -161,11 +161,11 @@ describe('SiLocaleService', () => { providers: [{ provide: SI_LOCALE_CONFIG, useValue: config }] }); service = TestBed.inject(SiLocaleService); - expect(service.hasLocale('de')).toBeTrue(); - expect(service.hasLocale('dex')).toBeFalse(); - expect(service.hasLocale('')).toBeFalse(); - expect(service.hasLocale()).toBeFalse(); - expect(service.hasLocale(undefined)).toBeFalse(); + expect(service.hasLocale('de')).toBe(true); + expect(service.hasLocale('dex')).toBe(false); + expect(service.hasLocale('')).toBe(false); + expect(service.hasLocale()).toBe(false); + expect(service.hasLocale(undefined)).toBe(false); }); describe('with default configuration', () => { diff --git a/projects/element-ng/main-detail-container/si-main-detail-container.component.spec.ts b/projects/element-ng/main-detail-container/si-main-detail-container.component.spec.ts index 975b4e357..500f70233 100644 --- a/projects/element-ng/main-detail-container/si-main-detail-container.component.spec.ts +++ b/projects/element-ng/main-detail-container/si-main-detail-container.component.spec.ts @@ -187,7 +187,7 @@ describe('MainDetailContainerComponent', () => { expect(htmlElement.querySelector('si-main-detail-container')?.classList).not.toContain( 'animate' ); - expect(htmlElement.classList.contains('animate')).toBeFalse(); + expect(htmlElement.classList.contains('animate')).toBe(false); }); }); @@ -244,7 +244,7 @@ describe('MainDetailContainerComponent', () => { jasmine.clock().tick(0); fixture.detectChanges(); // expect - expect(getInViewport(detailContainer)).toBeFalse(); + expect(getInViewport(detailContainer)).toBe(false); }); it('should set inert attribute to prevent focus hidden details when details are inactive', () => { @@ -289,7 +289,7 @@ describe('MainDetailContainerComponent', () => { htmlElement.querySelector('button')?.click(); fixture.detectChanges(); // expect - expect(component.detailsActive).toBeFalse(); + expect(component.detailsActive).toBe(false); }); it('should not show details back button', () => { @@ -310,7 +310,7 @@ describe('MainDetailContainerComponent', () => { jasmine.clock().tick(0); fixture.detectChanges(); // expect - expect(getInViewport(mainContainer)).toBeFalse(); + expect(getInViewport(mainContainer)).toBe(false); }); }); }); diff --git a/projects/element-ng/menu/si-menu.spec.ts b/projects/element-ng/menu/si-menu.spec.ts index c6d311506..a60ed0376 100644 --- a/projects/element-ng/menu/si-menu.spec.ts +++ b/projects/element-ng/menu/si-menu.spec.ts @@ -101,12 +101,12 @@ const withObjectType = { await toggle(); const menuItem = await rootLoader.getHarness(SiMenuItemHarness.with({ text: 'children' })); - expect(await menuItem.hasSubmenu()).toBeTrue(); + expect(await menuItem.hasSubmenu()).toBe(true); await menuItem.hover(); const menu = await menuItem.getSubmenu(); @@ -138,7 +138,7 @@ const withObjectType = { await toggle(); const menuItem = await rootLoader.getHarness(SiMenuItemHarness.with({ text: 'radio1' })); - expect(await menuItem.hasIcon('element-test-icon')).toBeTrue(); + expect(await menuItem.hasIcon('element-test-icon')).toBe(true); }); it('should have badge', async () => { @@ -150,19 +150,19 @@ const withObjectType = { await toggle(); const menuItem = await rootLoader.getHarness(SiMenuItemHarness.with({ text: 'first item' })); - expect(await menuItem.isDisabled()).toBeTrue(); + expect(await menuItem.isDisabled()).toBe(true); }); it('should update on object mutation', async () => { const disabledIndex = 1; await toggle(); const menuItem = await rootLoader.getHarness(SiMenuItemHarness.with({ text: 'first item' })); - expect(await menuItem.isDisabled()).toBeTrue(); + expect(await menuItem.isDisabled()).toBe(true); if (!fixture.componentInstance.items[disabledIndex].type) { fixture.componentInstance.items[disabledIndex].disabled = false; fixture.changeDetectorRef.markForCheck(); } - expect(await menuItem.isDisabled()).toBeFalse(); + expect(await menuItem.isDisabled()).toBe(false); }); it('should trigger an action', async () => { diff --git a/projects/element-ng/navbar-vertical/si-navbar-vertical.spec.ts b/projects/element-ng/navbar-vertical/si-navbar-vertical.spec.ts index 2a253f6f3..c022c1249 100644 --- a/projects/element-ng/navbar-vertical/si-navbar-vertical.spec.ts +++ b/projects/element-ng/navbar-vertical/si-navbar-vertical.spec.ts @@ -128,11 +128,11 @@ describe('SiNavbarVertical', () => { it('should expand/collapse navbar with click', async () => { component.collapsed = true; fixture.changeDetectorRef.markForCheck(); - expect(await harness.isCollapsed()).toBeTrue(); + expect(await harness.isCollapsed()).toBe(true); await harness.toggleCollapse(); - expect(await harness.isExpanded()).toBeTrue(); + expect(await harness.isExpanded()).toBe(true); await harness.toggleCollapse(); - expect(await harness.isCollapsed()).toBeTrue(); + expect(await harness.isCollapsed()).toBe(true); }); it('should expand on search button click with textonly false', async () => { @@ -140,24 +140,24 @@ describe('SiNavbarVertical', () => { component.collapsed = true; fixture.changeDetectorRef.markForCheck(); await harness.clickSearch(); - expect(await harness.isExpanded()).toBeTrue(); + expect(await harness.isExpanded()).toBe(true); }); it('should keep collapsed state during resize', async () => { const breakpointObserver = TestBed.inject(BreakpointObserverMock); await harness.toggleCollapse(); - expect(await harness.isCollapsed()).toBeTrue(); + expect(await harness.isCollapsed()).toBe(true); breakpointObserver.isSmall.next(true); - expect(await harness.isCollapsed()).toBeTrue(); + expect(await harness.isCollapsed()).toBe(true); breakpointObserver.isSmall.next(false); - expect(await harness.isCollapsed()).toBeTrue(); + expect(await harness.isCollapsed()).toBe(true); await harness.toggleCollapse(); - expect(await harness.isExpanded()).toBeTrue(); + expect(await harness.isExpanded()).toBe(true); breakpointObserver.isSmall.next(true); - expect(await harness.isCollapsed()).toBeTrue(); + expect(await harness.isCollapsed()).toBe(true); breakpointObserver.isSmall.next(false); - expect(await harness.isExpanded()).toBeTrue(); + expect(await harness.isExpanded()).toBe(true); }); it('should keep consumer provided collapsed state', async () => { @@ -167,9 +167,9 @@ describe('SiNavbarVertical', () => { breakpointObserver.isSmall.next(false); fixture.detectChanges(); breakpointObserver.isSmall.next(true); - expect(await harness.isCollapsed()).toBeTrue(); + expect(await harness.isCollapsed()).toBe(true); breakpointObserver.isSmall.next(false); - expect(await harness.isCollapsed()).toBeTrue(); + expect(await harness.isCollapsed()).toBe(true); }); it('should open flyout menu', async () => { @@ -179,10 +179,10 @@ describe('SiNavbarVertical', () => { const item = await harness.findItemByLabel('item-1'); await item.click(); await fixture.whenStable(); - expect(await item.isFlyout()).toBeTrue(); + expect(await item.isFlyout()).toBe(true); document.body.click(); await fixture.whenStable(); - expect(await item.isFlyout()).toBeFalse(); + expect(await item.isFlyout()).toBe(false); }); it('should emit search event', async () => { @@ -218,22 +218,22 @@ describe('SiNavbarVertical', () => { const item = await harness.findItemByLabel('item1'); await item.click(); let [subItem1, subItem2] = await item.getChildren(); - expect(await subItem1.isActive()).toBeFalse(); - expect(await subItem2.isActive()).toBeFalse(); - expect(await item.isActive()).toBeFalse(); + expect(await subItem1.isActive()).toBe(false); + expect(await subItem2.isActive()).toBe(false); + expect(await item.isActive()).toBe(false); await subItem1.click(); [subItem1, subItem2] = await item.getChildren(); - expect(await subItem1.isActive()).toBeTrue(); - expect(await subItem2.isActive()).toBeFalse(); + expect(await subItem1.isActive()).toBe(true); + expect(await subItem2.isActive()).toBe(false); await TestBed.inject(Router).navigate(['/item-1/sub-item-1/sub-path']); fixture.detectChanges(); - expect(await subItem1.isActive()).toBeFalse(); + expect(await subItem1.isActive()).toBe(false); await TestBed.inject(Router).navigate(['/item-1/sub-item-2/sub-path']); fixture.detectChanges(); [subItem1, subItem2] = await item.getChildren(); - expect(await subItem1.isActive()).toBeFalse(); - expect(await subItem2.isActive()).toBeTrue(); + expect(await subItem1.isActive()).toBe(false); + expect(await subItem2.isActive()).toBe(true); }); it('should support navigation legacy item', async () => { @@ -251,23 +251,23 @@ describe('SiNavbarVertical', () => { const [link, toggle] = await harness.findItems(); await link.click(); - expect(await toggle.isActive()).toBeTrue(); - expect(await link.isActive()).toBeTrue(); + expect(await toggle.isActive()).toBe(true); + expect(await link.isActive()).toBe(true); await toggle.click(); let [subItem1, subItem2] = await toggle.getChildren(); - expect(await subItem1.isActive()).toBeFalse(); - expect(await subItem2.isActive()).toBeFalse(); + expect(await subItem1.isActive()).toBe(false); + expect(await subItem2.isActive()).toBe(false); await subItem1.click(); [subItem1, subItem2] = await toggle.getChildren(); - expect(await subItem1.isActive()).toBeTrue(); - expect(await subItem2.isActive()).toBeFalse(); + expect(await subItem1.isActive()).toBe(true); + expect(await subItem2.isActive()).toBe(false); await TestBed.inject(Router).navigate(['/item-1/sub-item-2/sub-path']); fixture.detectChanges(); [subItem1, subItem2] = await toggle.getChildren(); - expect(await subItem1.isActive()).toBeFalse(); - expect(await subItem2.isActive()).toBeTrue(); + expect(await subItem1.isActive()).toBe(false); + expect(await subItem2.isActive()).toBe(true); }); }); @@ -291,9 +291,9 @@ describe('SiNavbarVertical', () => { const harness = await harnessLoader.getHarness(SiNavbarVerticalHarness); const [item1, item2] = await harness.findItems(); expect(await item1.getLabel()).toEqual('item1'); - expect(await item1.isExpanded()).toBeTrue(); + expect(await item1.isExpanded()).toBe(true); expect(await item2.getLabel()).toEqual('item2'); - expect(await item2.isExpanded()).toBeFalse(); + expect(await item2.isExpanded()).toBe(false); }); it('should save ui-state', async () => { @@ -305,7 +305,7 @@ describe('SiNavbarVertical', () => { const harness = await harnessLoader.getHarness(SiNavbarVerticalHarness); await harness.findItemByLabel('item2').then(item => item.click()); const state = await uiStateService.load(component.stateId!); - expect(state!.expandedItems.item2).toBeTrue(); + expect(state!.expandedItems.item2).toBe(true); }); it('should load/save UI State for new items style', async () => { @@ -316,8 +316,8 @@ describe('SiNavbarVertical', () => { const harness = await harnessLoader.getHarness(SiNavbarVerticalHarness); const [item1, item2] = await harness.findItems(); - expect(await item1.isExpanded()).toBeTrue(); - expect(await item2.isExpanded()).toBeFalse(); + expect(await item1.isExpanded()).toBe(true); + expect(await item2.isExpanded()).toBe(false); await item2.click(); await item1.click(); @@ -328,7 +328,7 @@ describe('SiNavbarVertical', () => { it('should restore collapsed state', async () => { await uiStateService.save(component.stateId!, { preferCollapse: true }); const harness = await harnessLoader.getHarness(SiNavbarVerticalHarness); - expect(await harness.isCollapsed()).toBeTrue(); + expect(await harness.isCollapsed()).toBe(true); }); it('should not restore expanded state on small screen', async () => { @@ -337,7 +337,7 @@ describe('SiNavbarVertical', () => { await uiStateService.save(component.stateId!, { preferCollapse: false }); const harness = await harnessLoader.getHarness(SiNavbarVerticalHarness); breakpointObserver.isSmall.next(true); - expect(await harness.isCollapsed()).toBeTrue(); + expect(await harness.isCollapsed()).toBe(true); }); }); }); diff --git a/projects/element-ng/navbar/si-navbar-primary/si-navbar-primary.component.spec.ts b/projects/element-ng/navbar/si-navbar-primary/si-navbar-primary.component.spec.ts index c6f75058d..d48f7b9f3 100644 --- a/projects/element-ng/navbar/si-navbar-primary/si-navbar-primary.component.spec.ts +++ b/projects/element-ng/navbar/si-navbar-primary/si-navbar-primary.component.spec.ts @@ -54,7 +54,7 @@ describe('SiNavbarPrimaryComponent', () => { }); it('should not render the launchpad trigger without app items', async () => { - expect(await harness.hasLaunchpad()).toBeFalse(); + expect(await harness.hasLaunchpad()).toBe(false); }); it('should render render launchpad with categories', async () => { diff --git a/projects/element-ng/number-input/si-number-input.component.spec.ts b/projects/element-ng/number-input/si-number-input.component.spec.ts index 8b8c8ed4c..2d545c980 100644 --- a/projects/element-ng/number-input/si-number-input.component.spec.ts +++ b/projects/element-ng/number-input/si-number-input.component.spec.ts @@ -236,7 +236,7 @@ describe('SiNumberInputComponent', () => { fakeClick('.dec'); - expect(component.form.controls.input.touched).toBeTrue(); + expect(component.form.controls.input.touched).toBe(true); }); it('updates the value in the form', () => { diff --git a/projects/element-ng/pagination/si-pagination.component.spec.ts b/projects/element-ng/pagination/si-pagination.component.spec.ts index 99e0f0c8e..986a89c48 100644 --- a/projects/element-ng/pagination/si-pagination.component.spec.ts +++ b/projects/element-ng/pagination/si-pagination.component.spec.ts @@ -82,24 +82,24 @@ describe('SiPaginationComponent', () => { let buttons = getNavButtons(); - expect(buttons.item(0).disabled).toBeTrue(); - expect(buttons.item(1).disabled).toBeFalse(); + expect(buttons.item(0).disabled).toBe(true); + expect(buttons.item(1).disabled).toBe(false); expect(getCurrentItem().innerHTML).toContain('1'); (buttons.item(1) as HTMLElement).click(); fixture.detectChanges(); buttons = getNavButtons(); - expect(buttons.item(0).disabled).toBeFalse(); - expect(buttons.item(1).disabled).toBeFalse(); + expect(buttons.item(0).disabled).toBe(false); + expect(buttons.item(1).disabled).toBe(false); expect(getCurrentItem().innerHTML).toContain('2'); (buttons.item(1) as HTMLElement).click(); fixture.detectChanges(); buttons = getNavButtons(); - expect(buttons.item(0).disabled).toBeFalse(); - expect(buttons.item(1).disabled).toBeTrue(); + expect(buttons.item(0).disabled).toBe(false); + expect(buttons.item(1).disabled).toBe(true); expect(getCurrentItem().innerHTML).toContain('3'); }); }); diff --git a/projects/element-ng/password-strength/si-password-strength.component.spec.ts b/projects/element-ng/password-strength/si-password-strength.component.spec.ts index 5d4fa13c2..e27b4b5d0 100644 --- a/projects/element-ng/password-strength/si-password-strength.component.spec.ts +++ b/projects/element-ng/password-strength/si-password-strength.component.spec.ts @@ -103,11 +103,11 @@ describe('SiPasswordStrengthDirective', () => { setInput('f'); - expect(element.classList.contains('bad')).toBeTrue(); + expect(element.classList.contains('bad')).toBe(true); setInput(''); - expect(element.classList.contains('bad')).toBeFalse(); + expect(element.classList.contains('bad')).toBe(false); expect(wrapperComponent.passwordStrengthChangedFunc).toHaveBeenCalledWith(-4); }); @@ -116,11 +116,11 @@ describe('SiPasswordStrengthDirective', () => { setInput('f3'); - expect(element.classList.contains('weak')).toBeTrue(); + expect(element.classList.contains('weak')).toBe(true); setInput(''); - expect(element.classList.contains('weak')).toBeFalse(); + expect(element.classList.contains('weak')).toBe(false); expect(wrapperComponent.passwordStrengthChangedFunc).toHaveBeenCalledWith(-3); }); @@ -129,11 +129,11 @@ describe('SiPasswordStrengthDirective', () => { setInput('s3K'); - expect(element.classList.contains('medium')).toBeTrue(); + expect(element.classList.contains('medium')).toBe(true); setInput(''); - expect(element.classList.contains('medium')).toBeFalse(); + expect(element.classList.contains('medium')).toBe(false); expect(wrapperComponent.passwordStrengthChangedFunc).toHaveBeenCalledWith(-2); }); @@ -142,11 +142,11 @@ describe('SiPasswordStrengthDirective', () => { setInput('s3K!'); - expect(element.classList.contains('good')).toBeTrue(); + expect(element.classList.contains('good')).toBe(true); setInput(''); - expect(element.classList.contains('good')).toBeFalse(); + expect(element.classList.contains('good')).toBe(false); expect(wrapperComponent.passwordStrengthChangedFunc).toHaveBeenCalledWith(-1); }); @@ -155,11 +155,11 @@ describe('SiPasswordStrengthDirective', () => { setInput('s3K!TEst'); - expect(element.classList.contains('strong')).toBeTrue(); + expect(element.classList.contains('strong')).toBe(true); setInput(''); - expect(element.classList.contains('strong')).toBeFalse(); + expect(element.classList.contains('strong')).toBe(false); expect(wrapperComponent.passwordStrengthChangedFunc).toHaveBeenCalledWith(0); }); @@ -175,7 +175,7 @@ describe('SiPasswordStrengthDirective', () => { fixture.detectChanges(); setInput('s3K! TEst'); - expect(element.classList.contains('strong')).toBeTrue(); + expect(element.classList.contains('strong')).toBe(true); }); it('should allow setting minRequiredPolicies', () => { @@ -184,7 +184,7 @@ describe('SiPasswordStrengthDirective', () => { // skip the uppercase setInput('s3K!test'); - expect(element.classList.contains('strong')).toBeTrue(); + expect(element.classList.contains('strong')).toBe(true); }); it('should show the icon, toggle', () => { diff --git a/projects/element-ng/phone-number/si-phone-number-input.component.spec.ts b/projects/element-ng/phone-number/si-phone-number-input.component.spec.ts index d916446a3..1e52f6388 100644 --- a/projects/element-ng/phone-number/si-phone-number-input.component.spec.ts +++ b/projects/element-ng/phone-number/si-phone-number-input.component.spec.ts @@ -152,7 +152,7 @@ describe('SiPhoneNumberInputComponent', () => { blurPhoneNumber(); fixture.detectChanges(); // Validate both the form control validity and also the final control value - expect(component.form.valid).toBeTrue(); + expect(component.form.valid).toBe(true); expect(component.form.controls.workPhone.value).toEqual('+49 30 123456'); }); @@ -196,7 +196,7 @@ describe('SiPhoneNumberInputComponent', () => { blurPhoneNumber(); fixture.detectChanges(); // Validate both the form control validity and also the final control value - expect(component.form.valid).toBeTrue(); + expect(component.form.valid).toBe(true); expect(component.form.controls.workPhone.value).toEqual('+91 1234 567 890'); }); @@ -206,7 +206,7 @@ describe('SiPhoneNumberInputComponent', () => { blurPhoneNumber(); fixture.detectChanges(); // Validate both the form control validity and also the final control value - expect(component.form.invalid).toBeTrue(); + expect(component.form.invalid).toBe(true); expect(component.form.controls.workPhone.value).toEqual('+91 01'); }); diff --git a/projects/element-ng/select/si-select.component.spec.ts b/projects/element-ng/select/si-select.component.spec.ts index 21903e483..df775d2fa 100644 --- a/projects/element-ng/select/si-select.component.spec.ts +++ b/projects/element-ng/select/si-select.component.spec.ts @@ -346,7 +346,7 @@ describe('SiSelectComponent', () => { fixture.detectChanges(); await selectHarness.open(); const item = await selectHarness.getList().then(list => list!.getItemByText('c')); - expect(await item.isActive()).toBeTrue(); + expect(await item.isActive()).toBe(true); }); it('should apply current filter when options are applied', async () => { @@ -457,7 +457,7 @@ describe('SiSelectComponent', () => { it('sets the disabled state', async () => { component.form.disable(); - expect(component.valueDirective().disabled()).toBeTrue(); + expect(component.valueDirective().disabled()).toBe(true); expect(await selectHarness.getTabindex()).toBe('-1'); }); }); diff --git a/projects/element-ng/side-panel/si-side-panel-service.spec.ts b/projects/element-ng/side-panel/si-side-panel-service.spec.ts index 904366e7c..042221358 100644 --- a/projects/element-ng/side-panel/si-side-panel-service.spec.ts +++ b/projects/element-ng/side-panel/si-side-panel-service.spec.ts @@ -40,9 +40,9 @@ describe('SiSidePanelService', () => { it('should toggle content', () => { service.open(); - expect(service.isOpen()).toBeTrue(); + expect(service.isOpen()).toBe(true); service.toggle(); - expect(service.isOpen()).toBeFalse(); + expect(service.isOpen()).toBe(false); }); }); diff --git a/projects/element-ng/slider/si-slider.component.spec.ts b/projects/element-ng/slider/si-slider.component.spec.ts index ca950a0fb..4d8132a6b 100644 --- a/projects/element-ng/slider/si-slider.component.spec.ts +++ b/projects/element-ng/slider/si-slider.component.spec.ts @@ -304,8 +304,8 @@ describe('SiSliderComponent', () => { expect(getValueIndicator().style.insetInlineStart).toBe('50%'); expect(getThumbHandle().style.insetInlineStart).toBe('50%'); - expect(element.querySelector('.decrement-button')?.disabled).toBeTrue(); - expect(element.querySelector('.increment-button')?.disabled).toBeTrue(); + expect(element.querySelector('.decrement-button')?.disabled).toBe(true); + expect(element.querySelector('.increment-button')?.disabled).toBe(true); }); }); @@ -329,7 +329,7 @@ describe('SiSliderComponent', () => { fakeClick('.decrement-button'); await fixture.whenStable(); - expect(component.form.controls.slider.touched).toBeTrue(); + expect(component.form.controls.slider.touched).toBe(true); }); it('updates the value in the form', async () => { @@ -344,8 +344,8 @@ describe('SiSliderComponent', () => { component.form.controls.slider.disable(); fixture.detectChanges(); - expect(element.querySelector('.decrement-button')?.disabled).toBeTrue(); - expect(element.querySelector('.increment-button')?.disabled).toBeTrue(); + expect(element.querySelector('.decrement-button')?.disabled).toBe(true); + expect(element.querySelector('.increment-button')?.disabled).toBe(true); }); it('should handle undefined value on change', () => { diff --git a/projects/element-ng/split/si-split.component.spec.ts b/projects/element-ng/split/si-split.component.spec.ts index d7fae7b50..e2dc7ffa9 100644 --- a/projects/element-ng/split/si-split.component.spec.ts +++ b/projects/element-ng/split/si-split.component.spec.ts @@ -417,9 +417,9 @@ describe('SiSplitComponent', () => { await TestBed.inject(SI_UI_STATE_SERVICE).load>('split-test'); expect(uiStateMock).toBeDefined(); - expect(uiStateMock!.one.expanded).toBeFalse(); - expect(uiStateMock!.two.expanded).toBeTrue(); - expect(uiStateMock!.three.expanded).toBeTrue(); + expect(uiStateMock!.one.expanded).toBe(false); + expect(uiStateMock!.two.expanded).toBe(true); + expect(uiStateMock!.three.expanded).toBe(true); }); }); diff --git a/projects/element-ng/summary-chip/si-summary-chip.component.spec.ts b/projects/element-ng/summary-chip/si-summary-chip.component.spec.ts index 6424bfd95..0717ab92a 100644 --- a/projects/element-ng/summary-chip/si-summary-chip.component.spec.ts +++ b/projects/element-ng/summary-chip/si-summary-chip.component.spec.ts @@ -47,19 +47,19 @@ describe('SiSummaryChipComponent', () => { it('should toggle selected state on click', () => { fixture.detectChanges(); - expect(fixture.componentInstance.selected()).toBeFalse(); + expect(fixture.componentInstance.selected()).toBe(false); element.querySelector('div')?.click(); - expect(fixture.componentInstance.selected()).toBeTrue(); + expect(fixture.componentInstance.selected()).toBe(true); }); it('should not toggle selected state on click when disabled', () => { componentRef.setInput('disabled', true); fixture.detectChanges(); - expect(fixture.componentInstance.selected()).toBeFalse(); + expect(fixture.componentInstance.selected()).toBe(false); element.querySelector('div')?.click(); - expect(fixture.componentInstance.selected()).toBeFalse(); + expect(fixture.componentInstance.selected()).toBe(false); }); }); diff --git a/projects/element-ng/summary-widget/si-summary-widget.component.spec.ts b/projects/element-ng/summary-widget/si-summary-widget.component.spec.ts index 07da462c7..3b345e4db 100644 --- a/projects/element-ng/summary-widget/si-summary-widget.component.spec.ts +++ b/projects/element-ng/summary-widget/si-summary-widget.component.spec.ts @@ -47,29 +47,29 @@ describe('SiSummaryWidgetComponent', () => { it('should toggle selected state on click', () => { fixture.detectChanges(); - expect(fixture.componentInstance.selected()).toBeFalse(); + expect(fixture.componentInstance.selected()).toBe(false); element.querySelector('div')?.click(); - expect(fixture.componentInstance.selected()).toBeTrue(); + expect(fixture.componentInstance.selected()).toBe(true); }); it('should not toggle selected state on click when disabled', () => { componentRef.setInput('disabled', true); fixture.detectChanges(); - expect(fixture.componentInstance.selected()).toBeFalse(); + expect(fixture.componentInstance.selected()).toBe(false); element.querySelector('div')?.click(); - expect(fixture.componentInstance.selected()).toBeFalse(); + expect(fixture.componentInstance.selected()).toBe(false); }); it('should not toggle selected state on click when readonly', () => { componentRef.setInput('readonly', true); fixture.detectChanges(); - expect(fixture.componentInstance.selected()).toBeFalse(); + expect(fixture.componentInstance.selected()).toBe(false); element.querySelector('div')?.click(); - expect(fixture.componentInstance.selected()).toBeFalse(); + expect(fixture.componentInstance.selected()).toBe(false); }); }); diff --git a/projects/element-ng/tabs-legacy/si-tabset/si-tabset-legacy.component.spec.ts b/projects/element-ng/tabs-legacy/si-tabset/si-tabset-legacy.component.spec.ts index cf3867cde..ab0bcc533 100644 --- a/projects/element-ng/tabs-legacy/si-tabset/si-tabset-legacy.component.spec.ts +++ b/projects/element-ng/tabs-legacy/si-tabset/si-tabset-legacy.component.spec.ts @@ -128,9 +128,9 @@ describe('SiTabset', () => { jasmine.clock().tick(1000); await fixture.whenStable(); - expect(getActive(0)).toBeTrue(); - expect(getActive(1)).toBeFalse(); - expect(getActive(2)).toBeFalse(); + expect(getActive(0)).toBe(true); + expect(getActive(1)).toBe(false); + expect(getActive(2)).toBe(false); expect(getLength()).toEqual(3); }); diff --git a/projects/element-ng/tabs/si-tabset.component.spec.ts b/projects/element-ng/tabs/si-tabset.component.spec.ts index 22d710cf8..e957162de 100644 --- a/projects/element-ng/tabs/si-tabset.component.spec.ts +++ b/projects/element-ng/tabs/si-tabset.component.spec.ts @@ -171,9 +171,9 @@ describe('SiTabset', () => { it('should be possible to add a few tabs to the tabComponent', async () => { testComponent.tabs = [{ heading: '1', active: true }, '2', '3']; fixture.detectChanges(); - expect(await tabsetHarness.isTabItemActive(0)).toBeTrue(); - expect(await tabsetHarness.isTabItemActive(1)).toBeFalse(); - expect(await tabsetHarness.isTabItemActive(2)).toBeFalse(); + expect(await tabsetHarness.isTabItemActive(0)).toBe(true); + expect(await tabsetHarness.isTabItemActive(1)).toBe(false); + expect(await tabsetHarness.isTabItemActive(2)).toBe(false); expect(await tabsetHarness.getTabItemsLength()).toEqual(3); }); @@ -247,14 +247,14 @@ describe('SiTabset', () => { ]; testComponent.wrapperWidth.set(300); fixture.detectChanges(); - expect(await tabsetHarness.isTabVisible(3)).toBeFalse(); + expect(await tabsetHarness.isTabVisible(3)).toBe(false); expect(await tabsetHarness.getOptionsMenuButton()).toBeDefined(); testComponent.wrapperWidth.set(500); detectSizeChange(); fixture.detectChanges(); jasmine.clock().tick(10); expect(await tabsetHarness.getOptionsMenuButton()).toBeNull(); - expect(await tabsetHarness.isTabVisible(3)).toBeTrue(); + expect(await tabsetHarness.isTabVisible(3)).toBe(true); }); it('should always scroll active tab into view', async () => { @@ -277,8 +277,8 @@ describe('SiTabset', () => { fixture.detectChanges(); expect(await tabsetHarness.getOptionsMenuButton()).toBeDefined(); - expect(await tabsetHarness.isTabVisible(6)).toBeTrue(); - expect(await tabsetHarness.isTabVisible(0)).toBeFalse(); + expect(await tabsetHarness.isTabVisible(6)).toBe(true); + expect(await tabsetHarness.isTabVisible(0)).toBe(false); tabs[0].active = true; tabs[6].active = false; @@ -289,8 +289,8 @@ describe('SiTabset', () => { jasmine.clock().tick(0); fixture.detectChanges(); - expect(await tabsetHarness.isTabVisible(0)).toBeTrue(); - expect(await tabsetHarness.isTabVisible(6)).toBeFalse(); + expect(await tabsetHarness.isTabVisible(0)).toBe(true); + expect(await tabsetHarness.isTabVisible(6)).toBe(false); }); it('should emit tab close event for closable tab and preserve active tab', async () => { @@ -353,7 +353,7 @@ describe('SiTabset', () => { testComponent.tabs = []; fixture.detectChanges(); testComponent.tabs = ['1', { heading: '2', active: true }, '3']; - expect(await tabsetHarness.isTabFocussable(1)).toBeTrue(); + expect(await tabsetHarness.isTabFocussable(1)).toBe(true); }); it('should not change active if canDeactivate returns false', async () => { @@ -362,18 +362,18 @@ describe('SiTabset', () => { { heading: '2', closable: true, canDeactivate: () => false } ]; fixture.detectChanges(); - expect(await tabsetHarness.isTabItemActive(0)).toBeTrue(); - expect(await tabsetHarness.isTabItemActive(1)).toBeFalse(); + expect(await tabsetHarness.isTabItemActive(0)).toBe(true); + expect(await tabsetHarness.isTabItemActive(1)).toBe(false); (await tabsetHarness.getTabItemButtonAt(1)).click(); fixture.detectChanges(); - expect(await tabsetHarness.isTabItemActive(0)).toBeFalse(); - expect(await tabsetHarness.isTabItemActive(1)).toBeTrue(); + expect(await tabsetHarness.isTabItemActive(0)).toBe(false); + expect(await tabsetHarness.isTabItemActive(1)).toBe(true); (await tabsetHarness.getTabItemButtonAt(0)).click(); fixture.detectChanges(); - expect(await tabsetHarness.isTabItemActive(0)).toBeFalse(); - expect(await tabsetHarness.isTabItemActive(1)).toBeTrue(); + expect(await tabsetHarness.isTabItemActive(0)).toBe(false); + expect(await tabsetHarness.isTabItemActive(1)).toBe(true); }); it('should not change active if canActivate returns false', async () => { @@ -382,13 +382,13 @@ describe('SiTabset', () => { { heading: '2', closable: true, canActivate: () => false } ]; fixture.detectChanges(); - expect(await tabsetHarness.isTabItemActive(0)).toBeTrue(); - expect(await tabsetHarness.isTabItemActive(1)).toBeFalse(); + expect(await tabsetHarness.isTabItemActive(0)).toBe(true); + expect(await tabsetHarness.isTabItemActive(1)).toBe(false); (await tabsetHarness.getTabItemButtonAt(1)).click(); fixture.detectChanges(); - expect(await tabsetHarness.isTabItemActive(0)).toBeTrue(); - expect(await tabsetHarness.isTabItemActive(1)).toBeFalse(); + expect(await tabsetHarness.isTabItemActive(0)).toBe(true); + expect(await tabsetHarness.isTabItemActive(1)).toBe(false); }); }); diff --git a/projects/element-ng/theme/si-theme-store.spec.ts b/projects/element-ng/theme/si-theme-store.spec.ts index 6af5649b7..f9d858413 100644 --- a/projects/element-ng/theme/si-theme-store.spec.ts +++ b/projects/element-ng/theme/si-theme-store.spec.ts @@ -43,7 +43,7 @@ describe('SiDefaultThemeStore', () => { it('should save theme to local storage', async () => { const theme: Theme = { name: 'test', schemes: {} }; const result = await firstValueFrom(store.saveTheme(theme)); - expect(result).toBeTrue(); + expect(result).toBe(true); const stored = localStorage.getItem(SI_THEME_LOCAL_STORAGE_KEY); expect(stored).toBeDefined(); expect(stored?.indexOf('test')).toBeGreaterThan(0); @@ -71,7 +71,7 @@ describe('SiDefaultThemeStore', () => { localStorage.setItem(SI_THEME_LOCAL_STORAGE_KEY, JSON.stringify(storage)); const result = await firstValueFrom(store.deleteTheme('test')); - expect(result).toBeTrue(); + expect(result).toBe(true); const stored = localStorage.getItem(SI_THEME_LOCAL_STORAGE_KEY); expect(stored).toBeDefined(); expect(stored?.indexOf('test')).toBeLessThan(0); @@ -85,7 +85,7 @@ describe('SiDefaultThemeStore', () => { localStorage.setItem(SI_THEME_LOCAL_STORAGE_KEY, JSON.stringify(storage)); const result = await firstValueFrom(store.activateTheme('test')); - expect(result).toBeTrue(); + expect(result).toBe(true); const storage2 = JSON.parse( localStorage.getItem(SI_THEME_LOCAL_STORAGE_KEY)! ) as ThemeStorage; @@ -101,7 +101,7 @@ describe('SiDefaultThemeStore', () => { localStorage.setItem(SI_THEME_LOCAL_STORAGE_KEY, JSON.stringify(storage)); const result = await firstValueFrom(store.deactivateTheme()); - expect(result).toBeTrue(); + expect(result).toBe(true); const storage2 = JSON.parse( localStorage.getItem(SI_THEME_LOCAL_STORAGE_KEY)! ) as ThemeStorage; @@ -129,7 +129,7 @@ describe('SiDefaultThemeStore', () => { localStorage.setItem(SI_THEME_LOCAL_STORAGE_KEY, JSON.stringify(storage)); const result = await firstValueFrom(store.activateTheme('test')); - expect(result).toBeFalse(); + expect(result).toBe(false); const storage2 = JSON.parse( localStorage.getItem(SI_THEME_LOCAL_STORAGE_KEY)! ) as ThemeStorage; @@ -150,12 +150,12 @@ describe('SiDefaultThemeStore', () => { it('activateTheme on node shall return false', async () => { const result = await firstValueFrom(store.activateTheme('any')); - expect(result).toBeFalse(); + expect(result).toBe(false); }); it('deactivateTheme on node shall return false', async () => { const result = await firstValueFrom(store.deactivateTheme()); - expect(result).toBeFalse(); + expect(result).toBe(false); }); it('loadThemeNames on node shall return []', async () => { @@ -166,7 +166,7 @@ describe('SiDefaultThemeStore', () => { it('saveTheme on node shall return false', async () => { const result = await firstValueFrom(store.saveTheme({ name: 'test', schemes: {} })); - expect(result).toBeFalse(); + expect(result).toBe(false); }); it('loadTheme on node shall return undefined', async () => { @@ -176,7 +176,7 @@ describe('SiDefaultThemeStore', () => { it('deleteTheme on node shall return false', async () => { const result = await firstValueFrom(store.deleteTheme('any')); - expect(result).toBeFalse(); + expect(result).toBe(false); }); }); }); diff --git a/projects/element-ng/theme/si-theme.service.spec.ts b/projects/element-ng/theme/si-theme.service.spec.ts index 81ecb5160..bbc331971 100644 --- a/projects/element-ng/theme/si-theme.service.spec.ts +++ b/projects/element-ng/theme/si-theme.service.spec.ts @@ -81,7 +81,7 @@ describe('SiThemeService', () => { it('setActiveTheme of unknown theme should return false', async () => { setupTestBed(); const result = await firstValueFrom(service.setActiveTheme('any')); - expect(result).toBeFalse(); + expect(result).toBe(false); }); it('should initially return undefined as active theme', async () => { @@ -93,7 +93,7 @@ describe('SiThemeService', () => { it('should use element as initial active theme', async () => { setupTestBed(); expect(service.activeThemeName).toBe(ELEMENT_THEME_NAME); - expect(service.hasTheme(ELEMENT_THEME_NAME)).toBeTrue(); + expect(service.hasTheme(ELEMENT_THEME_NAME)).toBe(true); expect(service.themeNames.length).toBe(1); const result = await firstValueFrom(service.getActiveTheme()); expect(result).toBeUndefined(); @@ -114,7 +114,7 @@ describe('SiThemeService', () => { it('addOrUpdateTheme should saveTheme on store', async () => { setupTestBed(false, store); const result = await firstValueFrom(service.addOrUpdateTheme(theme)); - expect(result).toBeTrue(); + expect(result).toBe(true); expect(store.saveTheme).toHaveBeenCalledTimes(1); expect(store.saveTheme).toHaveBeenCalledWith(theme); }); @@ -123,7 +123,7 @@ describe('SiThemeService', () => { store.saveTheme.and.callFake(() => of(false)); setupTestBed(false, store); const ok = await firstValueFrom(service.addOrUpdateTheme(theme)); - expect(ok).toBeFalse(); + expect(ok).toBe(false); }); it('addOrUpdateTheme should return error on storage errors', async () => { @@ -168,7 +168,7 @@ describe('SiThemeService', () => { store.deleteTheme.and.callFake(() => of(true)); setupTestBed(false, store); const result = await firstValueFrom(service.deleteTheme('any')); - expect(result).toBeFalse(); + expect(result).toBe(false); expect(store.deleteTheme).not.toHaveBeenCalled(); }); @@ -176,7 +176,7 @@ describe('SiThemeService', () => { store.deleteTheme.and.callFake(() => of(true)); setupTestBed(false, store); const result = await firstValueFrom(service.deleteTheme(theme.name)); - expect(result).toBeTrue(); + expect(result).toBe(true); expect(store.deleteTheme).toHaveBeenCalledWith(theme.name); }); @@ -184,7 +184,7 @@ describe('SiThemeService', () => { store.deleteTheme.and.callFake(() => of(false)); setupTestBed(false, store); const result = await firstValueFrom(service.deleteTheme(theme.name)); - expect(result).toBeFalse(); + expect(result).toBe(false); expect(store.deleteTheme).toHaveBeenCalledWith(theme.name); }); @@ -204,7 +204,7 @@ describe('SiThemeService', () => { store.deactivateTheme.and.callFake(() => of(true)); setupTestBed(false, store); const result = await firstValueFrom(service.setActiveTheme(ELEMENT_THEME_NAME)); - expect(result).toBeTrue(); + expect(result).toBe(true); expect(store.deactivateTheme).toHaveBeenCalledTimes(1); }); @@ -213,7 +213,7 @@ describe('SiThemeService', () => { setupTestBed(false, store); expect(service.activeThemeName).toBe('example'); const result = await firstValueFrom(service.setActiveTheme(ELEMENT_THEME_NAME)); - expect(result).toBeFalse(); + expect(result).toBe(false); expect(store.deactivateTheme).toHaveBeenCalledTimes(1); }); }); @@ -255,13 +255,13 @@ describe('SiThemeService', () => { it('setActiveTheme should invoke activateTheme on store', async () => { const result = await firstValueFrom(service.setActiveTheme(theme.name)); - expect(result).toBeTrue(); + expect(result).toBe(true); expect(store.activateTheme).toHaveBeenCalledTimes(1); }); it('setActiveTheme of current active theme should return true', async () => { const result = await firstValueFrom(service.setActiveTheme(ELEMENT_THEME_NAME)); - expect(result).toBeTrue(); + expect(result).toBe(true); expect(store.activateTheme).toHaveBeenCalledTimes(0); }); }); diff --git a/projects/element-ng/tree-view/si-tree-view.component.spec.ts b/projects/element-ng/tree-view/si-tree-view.component.spec.ts index 0d4885b08..669fa9bb9 100644 --- a/projects/element-ng/tree-view/si-tree-view.component.spec.ts +++ b/projects/element-ng/tree-view/si-tree-view.component.spec.ts @@ -167,7 +167,7 @@ describe('SiTreeViewComponent', () => { it('should contain folder state start', () => { component.folderStateStart = true; fixture.detectChanges(); - expect(component.treeViewComponent().folderStateStart()).toBeTrue(); + expect(component.treeViewComponent().folderStateStart()).toBe(true); expect( debugElement.query(By.css('.si-tree-view-root-ul .si-tree-view-li-item a .element-down-2')) ).toBeFalsy(); @@ -346,7 +346,7 @@ describe('SiTreeViewComponent', () => { it('should show dataField1', () => { component.enableDataField1 = true; fixture.detectChanges(); - expect(component.treeViewComponent().enableDataField1()).toBeTrue(); + expect(component.treeViewComponent().enableDataField1()).toBe(true); expect(debugElement.query(By.css('.si-tree-view-item-object-data-field-1'))).toBeTruthy(); expect(element.querySelector('.si-tree-view-item-object-data-field-1')!.innerHTML).toContain( 'Root1DataField1' @@ -356,7 +356,7 @@ describe('SiTreeViewComponent', () => { it('should show dataField2', () => { component.enableDataField2 = true; fixture.detectChanges(); - expect(component.treeViewComponent().enableDataField2()).toBeTrue(); + expect(component.treeViewComponent().enableDataField2()).toBe(true); expect(debugElement.query(By.css('.si-tree-view-item-object-data-field-2'))).toBeTruthy(); expect(element.querySelector('.si-tree-view-item-object-data-field-2')!.innerHTML).toContain( 'Root1DataField2' @@ -366,7 +366,7 @@ describe('SiTreeViewComponent', () => { it('should hide menu button', () => { component.enableContextMenuButton = false; fixture.detectChanges(); - expect(component.treeViewComponent().enableContextMenuButton()).toBeFalse(); + expect(component.treeViewComponent().enableContextMenuButton()).toBe(false); expect( debugElement.query(By.css('.si-tree-view-menu-btn.element-options-vertical')) ).toBeFalsy(); @@ -376,7 +376,7 @@ describe('SiTreeViewComponent', () => { component.contextMenuItems = [{ label: 'Title', type: 'action', action: () => {} }]; component.enableContextMenuButton = true; fixture.detectChanges(); - expect(component.treeViewComponent().enableContextMenuButton()).toBeTrue(); + expect(component.treeViewComponent().enableContextMenuButton()).toBe(true); expect( debugElement.query(By.css('.si-tree-view-menu-btn.element-options-vertical')) ).toBeTruthy(); @@ -386,14 +386,14 @@ describe('SiTreeViewComponent', () => { component.enableStateIndicator = false; fixture.changeDetectorRef.markForCheck(); fixture.detectChanges(); - expect(component.treeViewComponent().enableStateIndicator()).toBeFalse(); + expect(component.treeViewComponent().enableStateIndicator()).toBe(false); expect(debugElement.query(By.css('.si-tree-view-state-indicator'))).toBeFalsy(); }); it('should show state pipe', () => { component.enableStateIndicator = true; fixture.detectChanges(); - expect(component.treeViewComponent().enableStateIndicator()).toBeTrue(); + expect(component.treeViewComponent().enableStateIndicator()).toBe(true); expect(debugElement.query(By.css('.si-tree-view-state-indicator'))).toBeTruthy(); expect( debugElement.query(By.css('.si-tree-view-state-indicator')).styles['background-color'] @@ -438,7 +438,7 @@ describe('SiTreeViewComponent', () => { component.enableCheckbox = true; fixture.detectChanges(); const input = debugElement.query(By.css('.form-check-input')).nativeElement; - expect(component.treeViewComponent().enableCheckbox()).toBeTrue(); + expect(component.treeViewComponent().enableCheckbox()).toBe(true); expect(input.checked).toBeFalsy(); input.click(); @@ -455,7 +455,7 @@ describe('SiTreeViewComponent', () => { fixture.detectChanges(); const input = debugElement.query(By.css('.form-check-input')).nativeElement; expect(input.checked).toBeFalsy(); - expect(component.treeViewComponent().inheritChecked()).toBeTrue(); + expect(component.treeViewComponent().inheritChecked()).toBe(true); input.click(); await fixture.whenStable(); fixture.detectChanges(); @@ -473,7 +473,7 @@ describe('SiTreeViewComponent', () => { component.enableOptionbox = true; fixture.detectChanges(); const input = fixture.debugElement.query(By.css('.form-check-input')).nativeElement; - expect(component.treeViewComponent().enableOptionbox()).toBeTrue(); + expect(component.treeViewComponent().enableOptionbox()).toBe(true); expect(input.checked).toBeFalsy(); expect(input.type).toBe('radio'); }); @@ -519,7 +519,7 @@ describe('SiTreeViewComponent', () => { }); it('should return folderStateStart true as default', () => { - expect(component.folderStateStart).toBeTrue(); + expect(component.folderStateStart).toBe(true); }); it('should call onFlatTreeNavigateUp', () => { @@ -717,7 +717,7 @@ describe('SiTreeViewComponent', () => { component.expandCollapseAll = true; component.cdRef.markForCheck(); fixture.detectChanges(); - expect(component.treeViewComponent().deleteChildrenOnCollapse()).toBeTrue(); + expect(component.treeViewComponent().deleteChildrenOnCollapse()).toBe(true); element.querySelectorAll('.si-tree-view-item-toggle')[0].dispatchEvent(new Event('click')); fixture.detectChanges(); @@ -846,7 +846,7 @@ describe('SiTreeViewComponent', () => { element.querySelector('.si-tree-view')?.scroll(0, 5000); element.querySelector('.si-tree-view')?.dispatchEvent(new Event('scroll')); runOnPushChangeDetection(fixture); - expect(component.treeViewComponent().groupedList()).toBeTrue(); + expect(component.treeViewComponent().groupedList()).toBe(true); expect(element.querySelectorAll('si-tree-view-item').length).toBe(60); element.querySelector('.si-tree-view')?.scroll(0, 0); @@ -1090,7 +1090,7 @@ describe('SiTreeViewComponent', () => { }); it('default should be enableIcon', () => { - expect(component.treeViewComponent().enableIcon()).toBeTrue(); + expect(component.treeViewComponent().enableIcon()).toBe(true); }); describe('with icons', () => { diff --git a/projects/element-ng/tree-view/si-tree-view.model.spec.ts b/projects/element-ng/tree-view/si-tree-view.model.spec.ts index 599cb601b..b92e4d84c 100644 --- a/projects/element-ng/tree-view/si-tree-view.model.spec.ts +++ b/projects/element-ng/tree-view/si-tree-view.model.spec.ts @@ -155,6 +155,6 @@ describe('TreeItem and tree-helpers', () => { selectItemsBetween(treeRoot, treeRoot[0], treeRoot[1]); expect(treeRoot[0].selected).toBeFalsy(); - expect(treeRoot[1].selected).toBeTrue(); + expect(treeRoot[1].selected).toBe(true); }); });