Skip to content

Commit dfedbf0

Browse files
authored
Fix warnings in tests (canada-ca#1091)
This commit has a handful of minor tweaks to solve some of the things generating warnings in the tests.
1 parent b776ec8 commit dfedbf0

4 files changed

Lines changed: 11 additions & 5 deletions

File tree

frontend/src/DomainCard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,5 +126,5 @@ export function DomainCard({ url, lastRan, ...rest }) {
126126

127127
DomainCard.propTypes = {
128128
url: string.isRequired,
129-
lastRan: string.isRequired,
129+
lastRan: string,
130130
}

frontend/src/__tests__/FloatingMenu.test.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ import { UserStateProvider } from '../UserState'
88
import { MemoryRouter, Route } from 'react-router-dom'
99
import { fireEvent } from '@testing-library/dom'
1010

11-
// This defines the window.scrollBy work-around used for firefox on android
12-
Object.defineProperty(window, 'scrollBy', {
13-
value: jest.fn().mockImplementation(() => ({})),
14-
})
1511

1612
describe('<FloatingMenu>', () => {
1713
it('renders', async () => {

frontend/src/__tests__/OrganizationCard.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ describe('<OrganizationsCard />', () => {
1717
<OrganizationCard
1818
slug="tbs-sct-gc-ca"
1919
name="Treasury Board Secretariat"
20+
acronym="TBS"
2021
domainCount={7}
2122
/>
2223
</I18nProvider>

frontend/src/setupTests.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
11
import '@testing-library/jest-dom'
2+
3+
// This defines the window.scrollBy work-around used for firefox on android
4+
Object.defineProperty(window, 'scrollBy', {
5+
value: jest.fn().mockImplementation(() => ({})),
6+
})
7+
8+
window.alert = () => {}
9+
10+
window.matchMedia = () => ({})

0 commit comments

Comments
 (0)