Skip to content

Commit

Permalink
✅ Update tests and snapshots.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlee-dev committed Aug 27, 2019
1 parent e29f8f1 commit 8422544
Show file tree
Hide file tree
Showing 5 changed files with 162 additions and 8 deletions.
21 changes: 17 additions & 4 deletions src/__tests__/__snapshots__/App.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,24 @@ exports[`<App /> Should render the <App /> component. 1`] = `
<div
class="StyledBox-sc-13pk1d4-0 laNWCK"
>
<h3
class="StyledHeading-sc-1rdh4aw-0 ftOecI"
<div
class="StyledBox-sc-13pk1d4-0 gQLnBt"
>
Contracts
</h3>
<h3
class="StyledHeading-sc-1rdh4aw-0 ftOecI"
>
Contracts
</h3>
<div
class="StyledBox__StyledBoxGap-sc-13pk1d4-1 hyyRSo"
/>
<button
class="StyledButton-sc-323bzc-0 lnKzGb"
type="button"
>
Create
</button>
</div>
<div
class="StyledBox__StyledBoxGap-sc-13pk1d4-1 hPsznL"
/>
Expand Down
9 changes: 9 additions & 0 deletions src/__tests__/components/CreateContract.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { customRender } from '../../test-utils'
import CreateContract from '../../components/CreateContract'

describe('<CreateContract />', () => {
it('Should render the <CreateContract /> component.', () => {
const container = customRender({ component: CreateContract })
expect(container.asFragment()).toMatchSnapshot()
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,24 @@ exports[`<ContractsDisplay /> Should render the <ContractsDisplay /> component.
<div
class="StyledBox-sc-13pk1d4-0 laNWCK"
>
<h3
class="StyledHeading-sc-1rdh4aw-0 ftOecI"
<div
class="StyledBox-sc-13pk1d4-0 gQLnBt"
>
Contracts
</h3>
<h3
class="StyledHeading-sc-1rdh4aw-0 ftOecI"
>
Contracts
</h3>
<div
class="StyledBox__StyledBoxGap-sc-13pk1d4-1 hyyRSo"
/>
<button
class="StyledButton-sc-323bzc-0 lnKzGb"
type="button"
>
Create
</button>
</div>
<div
class="StyledBox__StyledBoxGap-sc-13pk1d4-1 hPsznL"
/>
Expand Down
118 changes: 118 additions & 0 deletions src/__tests__/components/__snapshots__/CreateContract.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`<CreateContract /> Should render the <CreateContract /> component. 1`] = `
<DocumentFragment>
<div
class="StyledBox-sc-13pk1d4-0 ipWbUu"
>
<label
for="item-type"
>
Item Type
</label>
<select
id="item-type"
>
<option
value="{\\"name\\":\\"Ore\\",\\"value\\":2,\\"volume\\":1}"
>
Ore
</option>
<option
value="{\\"name\\":\\"Plasma\\",\\"value\\":3,\\"volume\\":0.4}"
>
Plasma
</option>
<option
value="{\\"name\\":\\"Space Junk\\",\\"value\\":1,\\"volume\\":0.1}"
>
Space Junk
</option>
<option
value="{\\"name\\":\\"Antibiotics\\",\\"value\\":2,\\"volume\\":0.1}"
>
Antibiotics
</option>
<option
value="{\\"name\\":\\"Tobacco\\",\\"value\\":3,\\"volume\\":0.2}"
>
Tobacco
</option>
<option
value="{\\"name\\":\\"Soil\\",\\"volume\\":2,\\"value\\":0.5}"
>
Soil
</option>
<option
value="{\\"name\\":\\"Ammunition\\",\\"value\\":3,\\"volume\\":0.8}"
>
Ammunition
</option>
<option
value="{\\"name\\":\\"Glass\\",\\"value\\":1,\\"volume\\":1}"
>
Glass
</option>
<option
value="{\\"name\\":\\"Silver\\",\\"value\\":4,\\"volume\\":0.5}"
>
Silver
</option>
<option
value="{\\"name\\":\\"Gold\\",\\"value\\":5,\\"volume\\":0.5}"
>
Gold
</option>
</select>
<label
for="item-volume"
>
Item Volume
</label>
<input
disabled=""
id="item-volume"
type="number"
value="1"
/>
<label
for="item-value"
>
Item Value
</label>
<input
disabled=""
id="item-value"
type="number"
value="2"
/>
<label
for="item-destination"
>
Destination
</label>
<select
id="item-destination"
>
<option
value="0"
>
Test Planet 1
</option>
<option
value="1"
>
Test Planet 2
</option>
<option
value="2"
>
Test Planet 3
</option>
</select>
<button>
Create Contract
</button>
</div>
</DocumentFragment>
`;
1 change: 1 addition & 0 deletions src/fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const defaultState = {
travelDuration: null
},
ui: {
isCreatingContract: false,
view: 'Ship'
},
user: {
Expand Down

0 comments on commit 8422544

Please sign in to comment.