Skip to content

Commit

Permalink
DSEGOG-129 fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuadkitenge committed Jul 24, 2023
1 parent af49947 commit 9f69739
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/session/sessionSaveButtons.component.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ describe('session buttons', () => {
props = {
...props,
selectedSessionTimestamp: {
timestamp: '2023-06-29T14:45:00Z',
timestamp: '2023-06-29T15:45:00Z',
autoSaved: false,
},
};
Expand All @@ -188,7 +188,7 @@ describe('session buttons', () => {
props = {
...props,
selectedSessionTimestamp: {
timestamp: '2023-06-29T14:45:00Z',
timestamp: '2023-06-29T15:45:00Z',
autoSaved: true,
},
};
Expand Down
6 changes: 5 additions & 1 deletion src/session/sessionSaveButtons.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,14 @@ const SessionSaveButtons = (props: SessionsSaveButtonsProps) => {
const day = date.getDate();
const month = date.toLocaleString('default', { month: 'short' });
const year = date.getFullYear();
const hour = date.getHours();
const hour = date.getUTCHours();
const minute = date.getMinutes();

timestamp = `${day} ${month} ${year} ${hour}:${minute}`;
console.log(day);
console.log(hour);
console.log(timestamp);
console.log(selectedSessionTimestamp.timestamp);
}
return (
<Box
Expand Down
2 changes: 1 addition & 1 deletion src/views/viewTabs.component.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ describe('View Tabs', () => {
const element = screen.getByTestId('session-save-buttons-timestamp');

expect(element).toHaveTextContent(
'Session last autosaved: 29 Jun 2023 11:30'
'Session last autosaved: 29 Jun 2023 10:30'
);

const saveAsButton = screen.getByRole('button', { name: 'Save as' });
Expand Down

0 comments on commit 9f69739

Please sign in to comment.