Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snackbar for Avatar code updated feedback #799

Merged
merged 14 commits into from
Sep 12, 2018
Merged
3 changes: 2 additions & 1 deletion game_frontend/.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"cwd": "babelrc",
"root": ["./src"],
"alias": {
"features": "./src/redux/features"
"features": "./src/redux/features",
"theme": "./src/theme"
}
}],
"transform-class-properties"
Expand Down
2 changes: 1 addition & 1 deletion game_frontend/src/components/Code/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import createShallowWithTheme from 'testHelpers/createShallow'

describe('<Code />', () => {
it('renders correctly', () => {
const tree = createShallowWithTheme(<Code>Code</Code>)
const tree = createShallowWithTheme(<Code>Code</Code>, 'dark')
expect(tree).toMatchSnapshot()
})
})
7 changes: 5 additions & 2 deletions game_frontend/src/components/IDEConsole/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ import createShallowWithTheme from 'testHelpers/createShallow'

describe('<IDEConsole />', () => {
it('renders correctly', () => {
const tree = createShallowWithTheme(<IDEConsole logs={[{ timestamp: '1', log: 'hello' }, { timestamp: '2', log: 'bye' }]} />)
const tree = createShallowWithTheme(
<IDEConsole logs={[{ timestamp: '1', log: 'hello' }, { timestamp: '2', log: 'bye' }]} />,
'dark'
)
expect(tree).toMatchSnapshot()
})
})

describe('<StyledConsole />', () => {
it('renders correctly', () => {
const tree = createShallowWithTheme(<StyledConsole />)
const tree = createShallowWithTheme(<StyledConsole />, 'dark')
expect(tree).toMatchSnapshot()
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ exports[`<IDEEditor /> matches snapshot 1`] = `

exports[`<IDEEditorLayout /> renders correctly 1`] = `
.c0 {
background-color: #2F4F4F;
position: relative;
grid-area: ide-editor;
}
Expand All @@ -81,6 +80,9 @@ exports[`<MarginedPlayIcon /> matches snapshot 1`] = `
theme={
Object {
"additionalVariables": Object {
"snackbar": Object {
"borderRadius": "6px",
},
"typography": Object {
"code": Object {
"fontFamily": "'Source Code Pro', monospace",
Expand Down Expand Up @@ -122,7 +124,14 @@ exports[`<MarginedPlayIcon /> matches snapshot 1`] = `
"minHeight": 56,
},
},
"overrides": Object {},
"overrides": Object {
"MuiSnackbarContent": Object {
"root": Object {
"paddingLeft": "14px",
"paddingRight": "14px",
},
},
},
"palette": Object {
"action": Object {
"active": "#fff",
Expand Down Expand Up @@ -362,6 +371,9 @@ exports[`<RunCodeButton /> matches snapshot 1`] = `
theme={
Object {
"additionalVariables": Object {
"snackbar": Object {
"borderRadius": "6px",
},
"typography": Object {
"code": Object {
"fontFamily": "'Source Code Pro', monospace",
Expand Down Expand Up @@ -403,7 +415,14 @@ exports[`<RunCodeButton /> matches snapshot 1`] = `
"minHeight": 56,
},
},
"overrides": Object {},
"overrides": Object {
"MuiSnackbarContent": Object {
"root": Object {
"paddingLeft": "14px",
"paddingRight": "14px",
},
},
},
"palette": Object {
"action": Object {
"active": "#fff",
Expand Down
1 change: 0 additions & 1 deletion game_frontend/src/components/IDEEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import Button from '@material-ui/core/Button'
import PlayIcon from 'components/icons/Play'

export const IDEEditorLayout = styled.div`
background-color: #2F4F4F;
position: relative;
grid-area: ide-editor;
`
Expand Down
10 changes: 5 additions & 5 deletions game_frontend/src/components/IDEEditor/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('<IDEEditor />', () => {
postCode: jest.fn()
}

const component = createShallowWithTheme(<IDEEditor {...props} />)
const component = createShallowWithTheme(<IDEEditor {...props} />, 'dark')

expect(component).toMatchSnapshot()
})
Expand All @@ -22,7 +22,7 @@ describe('<IDEEditor />', () => {
postCode
}

const component = createShallowWithTheme(<IDEEditor {...props} />)
const component = createShallowWithTheme(<IDEEditor {...props} />, 'dark')

component.find('#post-code-button').simulate('click')
expect(postCode).toBeCalled()
Expand All @@ -31,22 +31,22 @@ describe('<IDEEditor />', () => {

describe('<IDEEditorLayout />', () => {
it('renders correctly', () => {
const tree = createShallowWithTheme(<IDEEditorLayout />)
const tree = createShallowWithTheme(<IDEEditorLayout />, 'dark')
expect(tree).toMatchSnapshot()
})
})

describe('<RunCodeButton />', () => {
it('matches snapshot', () => {
const component = createShallowWithTheme(<RunCodeButton />)
const component = createShallowWithTheme(<RunCodeButton />, 'dark')

expect(component).toMatchSnapshot()
})
})

describe('<MarginedPlayIcon />', () => {
it('matches snapshot', () => {
const component = createShallowWithTheme(<MarginedPlayIcon />)
const component = createShallowWithTheme(<MarginedPlayIcon />, 'dark')

expect(component).toMatchSnapshot()
})
Expand Down
14 changes: 10 additions & 4 deletions game_frontend/src/components/LogEntries/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,32 @@ import createShallowWithTheme from 'testHelpers/createShallow'

describe('<LogEntries />', () => {
it('renders correctly with logs', () => {
const tree = createShallowWithTheme(<LogEntries logs={[{ timestamp: '1', log: 'hello' }, { timestamp: 2, log: 'bye' }]} />)
const tree = createShallowWithTheme(
<LogEntries logs={[{ timestamp: '1', log: 'hello' }, { timestamp: 2, log: 'bye' }]} />,
'dark'
)
expect(tree).toMatchSnapshot()
})

it('renders correctly without logs', () => {
const tree = createShallowWithTheme(<LogEntries logs={[]} />)
const tree = createShallowWithTheme(<LogEntries logs={[]} />, 'dark')
expect(tree).toMatchSnapshot()
})
})

describe('<StyledLogEntries />', () => {
it('renders correctly', () => {
const tree = createShallowWithTheme(<StyledLogEntries logs={[{ timestamp: '1', log: 'hello' }, { timestamp: 2, log: 'bye' }]} />)
const tree = createShallowWithTheme(
<StyledLogEntries logs={[{ timestamp: '1', log: 'hello' }, { timestamp: 2, log: 'bye' }]} />,
'dark'
)
expect(tree).toMatchSnapshot()
})
})

describe('<LogEntry />', () => {
it('renders correctly', () => {
const tree = createShallowWithTheme(<LogEntry>hello</LogEntry>)
const tree = createShallowWithTheme(<LogEntry>hello</LogEntry>, 'dark')
expect(tree).toMatchSnapshot()
})
})
Loading