-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
π Merge pull request #54 from alexlee-dev/release
π¦ v0.2.0
- Loading branch information
Showing
32 changed files
with
2,194 additions
and
164 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 |
---|---|---|
@@ -1,5 +1,14 @@ | ||
describe('Fake Test', () => { | ||
it('Should pass.', () => { | ||
expect(1 + 1).toBe(2) | ||
import React from 'react' | ||
import { customRender } from '../test-utils' | ||
import App from '../App' | ||
|
||
jest.mock('../components/ItemTimer', () => { | ||
return () => <span>MockedTime</span> | ||
}) | ||
|
||
describe('<App />', () => { | ||
it('Should render the <App /> component.', () => { | ||
const container = customRender({ component: App }) | ||
expect(container.asFragment()).toMatchSnapshot() | ||
}) | ||
}) |
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,100 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`<App /> Should render the <App /> component. 1`] = ` | ||
<DocumentFragment> | ||
<div | ||
class="StyledBox-sc-13pk1d4-0 cXRmiT" | ||
> | ||
<h1 | ||
class="StyledHeading-sc-1rdh4aw-0 rfVJR" | ||
> | ||
Hermes | ||
</h1> | ||
<span> | ||
MockedTime | ||
</span> | ||
<div | ||
class="StyledBox-sc-13pk1d4-0 CAsMy" | ||
> | ||
<h2 | ||
class="StyledHeading-sc-1rdh4aw-0 gBloPj" | ||
> | ||
Cash: | ||
</h2> | ||
<span | ||
class="StyledText-sc-1sadyjn-0 fWSbXS" | ||
> | ||
100 | ||
</span> | ||
</div> | ||
<div | ||
class="StyledBox-sc-13pk1d4-0 dfMVfp" | ||
> | ||
<select | ||
data-testid="view-selector" | ||
> | ||
<option> | ||
Ship | ||
</option> | ||
<option> | ||
Planets | ||
</option> | ||
</select> | ||
</div> | ||
<div> | ||
<h2> | ||
Your Ship | ||
</h2> | ||
<h3> | ||
Cargo | ||
</h3> | ||
<div | ||
class="StyledBox-sc-13pk1d4-0 IRSNj" | ||
> | ||
<span | ||
class="StyledText-sc-1sadyjn-0 bnqisW" | ||
> | ||
Volume Remaining: | ||
</span> | ||
<span | ||
class="StyledText-sc-1sadyjn-0 fWSbXS" | ||
> | ||
5 | ||
</span> | ||
</div> | ||
<h3> | ||
Location: | ||
</h3> | ||
<div | ||
class="StyledBox-sc-13pk1d4-0 MmWcm" | ||
> | ||
<span | ||
class="StyledText-sc-1sadyjn-0 isVaoK" | ||
> | ||
Value: | ||
</span> | ||
<div | ||
class="StyledBox__StyledBoxGap-sc-13pk1d4-1 hPsznL" | ||
/> | ||
<span | ||
class="StyledText-sc-1sadyjn-0 gNZQxf" | ||
/> | ||
<div | ||
class="StyledBox__StyledBoxGap-sc-13pk1d4-1 hPsznL" | ||
/> | ||
<span | ||
class="StyledText-sc-1sadyjn-0 isVaoK" | ||
> | ||
Name: | ||
</span> | ||
<div | ||
class="StyledBox__StyledBoxGap-sc-13pk1d4-1 hPsznL" | ||
/> | ||
<span | ||
class="StyledText-sc-1sadyjn-0 gNZQxf" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</DocumentFragment> | ||
`; |
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,9 @@ | ||
import { customRender } from '../../test-utils' | ||
import CashDisplay from '../../components/CashDisplay' | ||
|
||
describe('<CashDisplay />', () => { | ||
it('Should render the <CashDisplay /> component.', () => { | ||
const container = customRender({ component: CashDisplay }) | ||
expect(container.asFragment()).toMatchSnapshot() | ||
}) | ||
}) |
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,17 @@ | ||
import { customRender } from '../../test-utils' | ||
import ItemTimer from '../../components/ItemTimer' | ||
|
||
jest.mock('../../util', () => { | ||
const moment = require('moment') | ||
const mockCreateDuration = () => moment.duration({ minutes: 60, seconds: 0 }) | ||
return { | ||
createDuration: mockCreateDuration | ||
} | ||
}) | ||
|
||
describe('<ItemTimer />', () => { | ||
it('Should render the <ItemTimer /> component.', () => { | ||
const container = customRender({ component: ItemTimer }) | ||
expect(container.asFragment()).toMatchSnapshot() | ||
}) | ||
}) |
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,9 @@ | ||
import Title from '../../components/Title' | ||
import { customRender } from '../../test-utils' | ||
|
||
describe('<Title />', () => { | ||
it('Should render the <Title /> component.', () => { | ||
const container = customRender({ component: Title }) | ||
expect(container.asFragment()).toMatchSnapshot() | ||
}) | ||
}) |
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,20 @@ | ||
import { fireEvent, waitForElement } from '@testing-library/react' | ||
import { customRender } from '../../test-utils' | ||
import ViewSelector from '../../components/ViewSelector' | ||
|
||
describe('<ViewSelector />', () => { | ||
it('Should render the <ViewSelector /> component.', () => { | ||
const container = customRender({ component: ViewSelector }) | ||
expect(container.asFragment()).toMatchSnapshot() | ||
}) | ||
|
||
it('Should handle changing the ViewSelector.', async () => { | ||
const { getByTestId } = customRender({ component: ViewSelector }) | ||
|
||
const selector = await waitForElement(() => getByTestId('view-selector')) | ||
|
||
expect(getByTestId('view-selector').value).toBe('Ship') | ||
fireEvent.change(selector, { target: { value: 'Planets' } }) | ||
expect(getByTestId('view-selector').value).toBe('Planets') | ||
}) | ||
}) |
20 changes: 20 additions & 0 deletions
20
src/__tests__/components/__snapshots__/CashDisplay.test.js.snap
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,20 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`<CashDisplay /> Should render the <CashDisplay /> component. 1`] = ` | ||
<DocumentFragment> | ||
<div | ||
class="StyledBox-sc-13pk1d4-0 CAsMy" | ||
> | ||
<h2 | ||
class="StyledHeading-sc-1rdh4aw-0 gBloPj" | ||
> | ||
Cash: | ||
</h2> | ||
<span | ||
class="StyledText-sc-1sadyjn-0 fWSbXS" | ||
> | ||
100 | ||
</span> | ||
</div> | ||
</DocumentFragment> | ||
`; |
9 changes: 9 additions & 0 deletions
9
src/__tests__/components/__snapshots__/ItemTimer.test.js.snap
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,9 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`<ItemTimer /> Should render the <ItemTimer /> component. 1`] = ` | ||
<DocumentFragment> | ||
<span> | ||
0 minutes 0 seconds | ||
</span> | ||
</DocumentFragment> | ||
`; |
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,11 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`<Title /> Should render the <Title /> component. 1`] = ` | ||
<DocumentFragment> | ||
<h1 | ||
class="StyledHeading-sc-1rdh4aw-0 rfVJR" | ||
> | ||
Hermes | ||
</h1> | ||
</DocumentFragment> | ||
`; |
20 changes: 20 additions & 0 deletions
20
src/__tests__/components/__snapshots__/ViewSelector.test.js.snap
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,20 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`<ViewSelector /> Should render the <ViewSelector /> component. 1`] = ` | ||
<DocumentFragment> | ||
<div | ||
class="StyledBox-sc-13pk1d4-0 dfMVfp" | ||
> | ||
<select | ||
data-testid="view-selector" | ||
> | ||
<option> | ||
Ship | ||
</option> | ||
<option> | ||
Planets | ||
</option> | ||
</select> | ||
</div> | ||
</DocumentFragment> | ||
`; |
Oops, something went wrong.