Skip to content
Prev Previous commit
Next Next commit
test: TT-304 Handle message: Editind and creating unit tets
  • Loading branch information
Edgar Guaman committed Aug 21, 2021
commit 2437144514b4b07c2aa1544a668c7cc0899e12bf
18 changes: 13 additions & 5 deletions src/app/modules/time-entries/pages/time-entries.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -670,14 +670,22 @@ describe('TimeEntriesComponent', () => {
});

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

expect(component.checkIfDataSourceIsLoading(state.timeEntriesDataSource)).toEqual(expectedValue);
it('checkIfDataSourceIsLoading should be true when dataSource.isLoading is true', () => {
state.timeEntriesDataSource.isLoading = true;

expect(component.checkIfDataSourceIsLoading(state.timeEntriesDataSource)).toBeTrue();
});

it('checkIfDataSourceIsEmpty should be false when dataSource.data.length is not zero', () => {
const expectedValue = false;
it('checkIfDataSourceIsEmpty should be false when dataSource.data.length is not empty', () => {
expect(component.checkIfDataSourceIsEmpty(state.timeEntriesDataSource)).toBeFalse();
});

it('checkIfDataSourceIsEmpty should be true when dataSource.data.length is empty', () => {
state.timeEntriesDataSource.data = [];

expect(component.checkIfDataSourceIsEmpty(state.timeEntriesDataSource)).toEqual(expectedValue);
expect(component.checkIfDataSourceIsEmpty(state.timeEntriesDataSource)).toBeTrue();
});
});