-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into anne_wbs_task_spacing_fix
- Loading branch information
Showing
133 changed files
with
13,477 additions
and
4,828 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
// other settings | ||
// formatting using eslint | ||
// let editor format using prettier for all other files | ||
"editor.formatOnSave": true, | ||
// disable editor formatting, so eslint can handle it | ||
"[javascript]": { | ||
"editor.formatOnSave": true | ||
}, | ||
//"eslint.enable": true, | ||
// available through eslint plugin in vscode | ||
"eslint.alwaysShowStatus": true, | ||
"editor.tabSize": 2, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "explicit" | ||
}, | ||
"files.exclude": { | ||
"**/.classpath": true, | ||
"**/.project": true, | ||
"**/.settings": true, | ||
"**/.factorypath": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import React from 'react'; | ||
import moment from 'moment'; | ||
import { render, screen, waitFor } from '@testing-library/react'; | ||
import { unmountComponentAtNode } from "react-dom"; | ||
import '@testing-library/jest-dom/extend-expect'; | ||
|
||
import CountdownTimer from 'components/WeeklySummary/CountdownTimer'; | ||
|
||
let container = null; | ||
beforeEach(() => { | ||
// setup a DOM element as a render target | ||
container = document.createElement("div"); | ||
document.body.appendChild(container); | ||
}); | ||
|
||
afterEach(() => { | ||
// cleanup on exiting | ||
unmountComponentAtNode(container); | ||
container.remove(); | ||
container = null; | ||
}); | ||
|
||
describe('Time Countdown Timer Test', () => { | ||
it('displays "Time\'s Up" message when timer finished 1 second ago', async () => { | ||
// Set the time to 1 second ago. | ||
const tickTest = moment().subtract(1, 'seconds'); | ||
render(<CountdownTimer date={tickTest} />, container); | ||
|
||
await waitFor(() => screen.getByText("Time's up!")); | ||
|
||
expect(screen.getByText("Time's up!")).toBeInTheDocument(); | ||
}); | ||
}); | ||
|
||
describe('Time Countdown Timer Test', () => { | ||
it('displays "Time\'s Up" message when timer finished at the same time', async () => { | ||
// Set the time to the current time. | ||
const tickTest = moment().subtract(0, 'seconds'); | ||
render(<CountdownTimer date={tickTest} />, container); | ||
|
||
await waitFor(() => screen.getByText("Time's up!")); | ||
expect(screen.getByText("Time's up!")).toBeInTheDocument(); | ||
}); | ||
}); | ||
|
||
describe('Time Countdown Timer Test', () => { | ||
it('displays "Time\'s Up" message when timer finished 999 seconds ago', async () => { | ||
// Set the time to 999 seconds ago. | ||
const tickTest = moment().subtract(999, 'seconds'); | ||
render(<CountdownTimer date={tickTest} />, container); | ||
|
||
await waitFor(() => screen.getByText("Time's up!")); | ||
expect(screen.getByText("Time's up!")).toBeInTheDocument(); | ||
}); | ||
}); | ||
|
||
describe('Time Countdown Timer Test', () => { | ||
it('displays "Sec" when timer is not finished', () => { | ||
// Set the time to 999 seconds later. | ||
const tickTest = moment().subtract(-999, 'seconds'); | ||
render(<CountdownTimer date={tickTest} />, container); | ||
|
||
expect(screen.getByText("Sec")).toBeInTheDocument(); | ||
}); | ||
}); | ||
|
||
describe('Time Countdown Timer Test', () => { | ||
it('displays "Time\'s Up" message when timer will be finished 1 second later', () => { | ||
// Set the time to the 1 second later. | ||
const tickTest = moment().subtract(-1, 'seconds'); | ||
render(<CountdownTimer date={tickTest} />, container); | ||
|
||
expect(screen.getByText("Sec")).toBeInTheDocument(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.