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 b5f1c08 commit 7e44988
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 3 deletions.
16 changes: 16 additions & 0 deletions src/__tests__/__snapshots__/App.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,22 @@ exports[`<App /> Should render the <App /> component. 1`] = `
<div
class="StyledBox__StyledBoxGap-sc-13pk1d4-1 iChEkS"
/>
<span
class="StyledText-sc-1sadyjn-0 bnqisW"
>
Destination
</span>
<div
class="StyledBox__StyledBoxGap-sc-13pk1d4-1 iChEkS"
/>
<span
class="StyledText-sc-1sadyjn-0 fWSbXS"
>
Test Planet 2
</span>
<div
class="StyledBox__StyledBoxGap-sc-13pk1d4-1 iChEkS"
/>
<button
class="StyledButton-sc-323bzc-0 jJyttA"
disabled=""
Expand Down
12 changes: 10 additions & 2 deletions src/__tests__/components/ContractsDisplay.test.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import { customRender } from '../../test-utils'
import ContractsDisplay from '../../components/ContractsDisplay'
import { defaultState } from '../../fixtures'
import { fireEvent } from '@testing-library/dom';
import { fireEvent } from '@testing-library/dom'

const customState = {
...defaultState,
user: {
...defaultState.user,
contracts: [{ id: '0', itemType: 'Plasma', value: 2, volume: 1 }]
contracts: [
{
destination: { name: 'Planet 1', value: 0 },
id: '0',
itemType: 'Plasma',
value: 2,
volume: 1
}
]
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,22 @@ exports[`<ContractsDisplay /> Should render the <ContractsDisplay /> component.
<div
class="StyledBox__StyledBoxGap-sc-13pk1d4-1 iChEkS"
/>
<span
class="StyledText-sc-1sadyjn-0 bnqisW"
>
Destination
</span>
<div
class="StyledBox__StyledBoxGap-sc-13pk1d4-1 iChEkS"
/>
<span
class="StyledText-sc-1sadyjn-0 fWSbXS"
>
Test Planet 2
</span>
<div
class="StyledBox__StyledBoxGap-sc-13pk1d4-1 iChEkS"
/>
<button
class="StyledButton-sc-323bzc-0 jJyttA"
disabled=""
Expand Down
4 changes: 3 additions & 1 deletion src/__tests__/util.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ describe('Utilities', () => {
})

it('Should test generateContracts().', () => {
expect(generateContracts().length).toBe(5)
expect(
generateContracts([{ location: 50, name: 'Test Planet 2' }]).length
).toBe(5)
})
})
1 change: 1 addition & 0 deletions src/fixtures.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const defaultState = {
world: {
contracts: [
{
destination: { name: 'Test Planet 2', value: 50 },
id: '0',
itemType: 'Ore',
volume: 1,
Expand Down

0 comments on commit 7e44988

Please sign in to comment.