-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix(responsive): use defaultmatches for all uses - test: add ssr tests for Box, Button, ExpandCollapse, DisplayHeading, Heading, Tooltip - upgrade jest to 22.x - add testid to ExpandCollapse tertiarytext in order to be selectable * test: adjust server side rendering descriptors * refactor(tests): remove dirty laundry 👕
- Loading branch information
1 parent
2885e93
commit 314bc55
Showing
17 changed files
with
647 additions
and
348 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,16 @@ | ||
/** | ||
* @jest-environment node | ||
*/ | ||
|
||
import React from 'react' | ||
import { render } from 'enzyme' | ||
|
||
import Box from '../Box' | ||
|
||
describe('Box server side rendering', () => { | ||
it('uses mobile styles first', () => { | ||
const box = render(<Box horizontal={4}>Submit</Box>) | ||
|
||
expect(box.hasClass('horizontalPadding-4')).toBe(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
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,16 @@ | ||
/** | ||
* @jest-environment node | ||
*/ | ||
|
||
import React from 'react' | ||
import { render } from 'enzyme' | ||
|
||
import Button from '../Button' | ||
|
||
describe('Button server side rendering', () => { | ||
it('uses mobile styles first', () => { | ||
const button = render(<Button>Submit</Button>) | ||
|
||
expect(button.hasClass('fullWidth')).toBe(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
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
24 changes: 24 additions & 0 deletions
24
src/components/ExpandCollapse/__tests__/ExpandCollapse.ssr.spec.jsx
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,24 @@ | ||
/** | ||
* @jest-environment node | ||
*/ | ||
|
||
import React from 'react' | ||
import { render } from 'enzyme' | ||
|
||
import ExpandCollapse from '../ExpandCollapse' | ||
|
||
describe('ExpandCollapse server side rendering', () => { | ||
it('uses mobile styles first', () => { | ||
const expandCollapse = render( | ||
<ExpandCollapse> | ||
<ExpandCollapse.Panel id="ssr" header="Yes" tertiaryText="Is that so?"> | ||
Here's what's inside | ||
</ExpandCollapse.Panel> | ||
</ExpandCollapse> | ||
) | ||
|
||
const panel = expandCollapse.find('[data-testid="ssr"]') | ||
|
||
expect(panel.find('[data-testid="tertiarytext"]').hasClass('medium')).toBe(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
16 changes: 16 additions & 0 deletions
16
src/components/Link/ButtonLink/__tests__/ButtonLink.ssr.spec.jsx
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,16 @@ | ||
/** | ||
* @jest-environment node | ||
*/ | ||
|
||
import React from 'react' | ||
import { render } from 'enzyme' | ||
|
||
import ButtonLink from '../ButtonLink' | ||
|
||
describe('ButtonLink server side rendering', () => { | ||
it('uses mobile styles first', () => { | ||
const button = render(<ButtonLink>Submit</ButtonLink>) | ||
|
||
expect(button.hasClass('fullWidth')).toBe(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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* @jest-environment node | ||
*/ | ||
|
||
import React from 'react' | ||
import { render } from 'enzyme' | ||
|
||
import Tooltip from '../Tooltip' | ||
|
||
describe('Tooltip server side rendering', () => { | ||
it('uses mobile styles first', () => { | ||
const tooltip = render(<Tooltip>My tooltip text</Tooltip>) | ||
|
||
expect(tooltip.find('[data-testid=bubble]').hasClass('full')).toBe(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
16 changes: 16 additions & 0 deletions
16
src/components/Typography/DisplayHeading/__tests__/DisplayHeading.ssr.spec.jsx
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,16 @@ | ||
/** | ||
* @jest-environment node | ||
*/ | ||
|
||
import React from 'react' | ||
import { render } from 'enzyme' | ||
|
||
import DisplayHeading from '../DisplayHeading' | ||
|
||
describe('DisplayHeading server side rendering', () => { | ||
it('uses mobile styles first', () => { | ||
const heading = render(<DisplayHeading>My heading text</DisplayHeading>) | ||
|
||
expect(heading.hasClass('heading')).toBe(true) | ||
}) | ||
}) |
Oops, something went wrong.