Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: TTL-886 add time zone tests
  • Loading branch information
Santiago220991 committed May 23, 2023
commit 83de7ed0777f11d7890148e33b65df06cd1201b0
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
[dtTrigger]="dtTrigger"
[dtOptions]="dtOptions"
*ngIf="reportDataSource$ | async as dataSource"
id="time-entries-table"
>
<thead class="thead-blue">
<tr class="d-flex">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ describe('Reports Page', () => {
uri: 'custom uri',
project_id: '123',
project_name: 'Time-Tracker',
timezone_offset: 300,
};

const timeEntryList: Entry[] = [
Expand Down Expand Up @@ -253,6 +254,25 @@ describe('Reports Page', () => {
});
});

it('Should render column header called Time Zone', () => {
const table = document.querySelector('table#time-entries-table');
const tableHeaderElements = Array.from(table.getElementsByTagName('th'));
const tableHeaderTitles = tableHeaderElements.map(element => (element.textContent));
expect(tableHeaderTitles).toContain('Time zone');
});

it('Should render a cell content with UTC text', () => {
const TIME_ZONE_CELL_NUMBER = 7;
const TABLE_ROW_NUMBER = 1;
const table = document.querySelector('table#time-entries-table');
const arrayTableRows = Array.from(table.getElementsByTagName('tr'));
const tablerow = arrayTableRows[TABLE_ROW_NUMBER];
const cells = Array.from(tablerow.getElementsByTagName('td'));
const cell = cells[TIME_ZONE_CELL_NUMBER].textContent;
expect(cell).toContain('UTC-5');
});


afterEach(() => {
fixture.destroy();
});
Expand Down
1 change: 1 addition & 0 deletions src/app/modules/shared/models/entry.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface Entry {

customer_id?: string;
customer_name?: string;
timezone_offset?: number;
}

export interface NewEntry {
Expand Down