-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ededbd
commit b92fe9a
Showing
11 changed files
with
109 additions
and
26 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
49 changes: 49 additions & 0 deletions
49
...src/components/TestSuite/TestSuiteDetails/TestListItem/__tests__/InputOutputList.test.tsx
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,49 @@ | ||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
import { SnackbarProvider } from 'notistack'; | ||
import ThemeProvider from 'components/ThemeProvider'; | ||
|
||
import { TestInput, TestOutput } from '~/models/testSuiteModels'; | ||
import InputOutputList from '../InputOutputList'; | ||
|
||
describe('The InputOutputsList component', () => { | ||
test('it renders all inputs', () => { | ||
const inputs: TestInput[] = [ | ||
{ name: 'one', value: 1 }, | ||
{ name: 'two', value: 2 }, | ||
]; | ||
|
||
render( | ||
<ThemeProvider> | ||
<SnackbarProvider> | ||
<InputOutputList inputOutputs={inputs} noValuesMessage="No Inputs" headerName="Input" /> | ||
</SnackbarProvider> | ||
</ThemeProvider> | ||
); | ||
|
||
const renderedMessages = document.querySelectorAll('tbody > tr'); | ||
expect(renderedMessages.length).toEqual(inputs.length); | ||
}); | ||
|
||
test('it renders all outputs', () => { | ||
const outputs: TestOutput[] = [ | ||
{ name: 'one', value: '1' }, | ||
{ name: 'two', value: '2' }, | ||
]; | ||
|
||
render( | ||
<ThemeProvider> | ||
<SnackbarProvider> | ||
<InputOutputList | ||
inputOutputs={outputs} | ||
noValuesMessage="No Outputs" | ||
headerName="Output" | ||
/> | ||
</SnackbarProvider> | ||
</ThemeProvider> | ||
); | ||
|
||
const renderedMessages = document.querySelectorAll('tbody > tr'); | ||
expect(renderedMessages.length).toEqual(outputs.length); | ||
}); | ||
}); |
28 changes: 28 additions & 0 deletions
28
client/src/components/TestSuite/TestSuiteDetails/TestListItem/__tests__/MessageList.test.tsx
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,28 @@ | ||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
import { SnackbarProvider } from 'notistack'; | ||
import ThemeProvider from 'components/ThemeProvider'; | ||
|
||
import MessageList from '../MessageList'; | ||
import { Message } from '~/models/testSuiteModels'; | ||
|
||
describe('The MessagesList component', () => { | ||
test('it renders all messages', () => { | ||
const messages: Message[] = [ | ||
{ message: 'info', type: 'info' }, | ||
{ message: 'warning', type: 'warning' }, | ||
{ message: 'error', type: 'error' }, | ||
]; | ||
|
||
render( | ||
<ThemeProvider> | ||
<SnackbarProvider> | ||
<MessageList messages={messages} /> | ||
</SnackbarProvider> | ||
</ThemeProvider> | ||
); | ||
|
||
const renderedMessages = document.querySelectorAll('tbody > tr'); | ||
expect(renderedMessages.length).toEqual(messages.length); | ||
}); | ||
}); |
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