Skip to content

Commit 2437144

Browse files
author
Edgar Guaman
committed
test: TT-304 Handle message: Editind and creating unit tets
1 parent cc6bed4 commit 2437144

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/app/modules/time-entries/pages/time-entries.component.spec.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -670,14 +670,22 @@ describe('TimeEntriesComponent', () => {
670670
});
671671

672672
it('checkIfDataSourceIsLoading should be false when dataSource.isLoading is false', () => {
673-
const expectedValue = false;
673+
expect(component.checkIfDataSourceIsLoading(state.timeEntriesDataSource)).toBeFalse();
674+
});
674675

675-
expect(component.checkIfDataSourceIsLoading(state.timeEntriesDataSource)).toEqual(expectedValue);
676+
it('checkIfDataSourceIsLoading should be true when dataSource.isLoading is true', () => {
677+
state.timeEntriesDataSource.isLoading = true;
678+
679+
expect(component.checkIfDataSourceIsLoading(state.timeEntriesDataSource)).toBeTrue();
676680
});
677681

678-
it('checkIfDataSourceIsEmpty should be false when dataSource.data.length is not zero', () => {
679-
const expectedValue = false;
682+
it('checkIfDataSourceIsEmpty should be false when dataSource.data.length is not empty', () => {
683+
expect(component.checkIfDataSourceIsEmpty(state.timeEntriesDataSource)).toBeFalse();
684+
});
685+
686+
it('checkIfDataSourceIsEmpty should be true when dataSource.data.length is empty', () => {
687+
state.timeEntriesDataSource.data = [];
680688

681-
expect(component.checkIfDataSourceIsEmpty(state.timeEntriesDataSource)).toEqual(expectedValue);
689+
expect(component.checkIfDataSourceIsEmpty(state.timeEntriesDataSource)).toBeTrue();
682690
});
683691
});

0 commit comments

Comments
 (0)