-
Notifications
You must be signed in to change notification settings - Fork 11
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
Showing
10 changed files
with
159 additions
and
12 deletions.
There are no files selected for viewing
Binary file modified
BIN
-1.03 KB
(98%)
...s__/__image_snapshots__/dialog-test-js-components-dialog-with-scroll-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+119 KB
...tests__/__image_snapshots__/logs-test-js-components-logs-with-dialog-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,15 @@ | ||
import { baisy } from '../setup/TestSuiter'; | ||
|
||
|
||
const SUITES = [ | ||
baisy.suite('Components/Logs', 'with dialog') | ||
.setRoot(async (iframe) => { | ||
return await iframe.waitForXPath('//*[@data-e2e-id="logs-dialog"]'); | ||
}), | ||
]; | ||
|
||
|
||
SUITES.map(suite => { | ||
it(suite.getTestName(), suite.testStory, 20000); | ||
}); | ||
|
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,25 @@ | ||
// @flow | ||
import React from 'react'; | ||
import { LogsContainerTag, LogMessageTag } from './Logs.theme'; | ||
|
||
type LogsProps = { | ||
messages: string[], | ||
}; | ||
|
||
const Logs = ({ messages }: LogsProps) => { | ||
return ( | ||
<LogsContainerTag> | ||
{ React.Children.toArray(messages.map(message => ( | ||
<LogMessageTag>{ message }</LogMessageTag> // eslint-disable-line | ||
))) } | ||
</LogsContainerTag> | ||
); | ||
}; | ||
|
||
Logs.defaultProps = { | ||
messages: [], | ||
}; | ||
|
||
export { | ||
Logs, | ||
}; |
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,57 @@ | ||
import React from 'react'; | ||
|
||
const MESSAGES = [ | ||
`START RequestId: 9ddb9717-1570-433e-bb06-9e0c3c4fefac Version: $LATEST | ||
,2019-03-12T15:08:49.840Z 9ddb9717-1570-433e-bb06-9e0c3c4fefac {"errorMessage":"Cannot find module 'nodemailer'","errorType":"Error","stackTrace":["Function.Module._resolveFilename (module.js:547:15)","Function.Module._load (module.js:474:25)","Module.require (module.js:596:17)","require (internal/module.js:11:18)","Object.<anonymous> (/var/task/src/mailer/index.js:37:18)","Module._compile (module.js:652:30)","Object.Module._extensions..js (module.js:663:10)","Module.load (module.js:565:32)","tryModuleLoad (module.js:505:12)","Function.Module._load (module.js:497:3)"]} | ||
,END RequestId: 9ddb9717-1570-433e-bb06-9e0c3c4fefac | ||
,REPORT RequestId: 9ddb9717-1570-433e-bb06-9e0c3c4fefac Duration: 1.23 ms Billed Duration: 100 ms Memory Size: 1536 MB Max Memory Used: 77 MB | ||
,START RequestId: 60594137-ec13-4470-a85d-61e29cc184e2 Version: $LATEST | ||
,2019-03-12T15:09:39.835Z 60594137-ec13-4470-a85d-61e29cc184e2 entered function | ||
,END RequestId: 60594137-ec13-4470-a85d-61e29cc184e2 | ||
,REPORT RequestId: 60594137-ec13-4470-a85d-61e29cc184e2 Duration: 21.12 ms Billed Duration: 100 ms Memory Size: 1536 MB Max Memory Used: 77 MB | ||
,START RequestId: ff316ab5-4c16-47b4-be44-079ce5968761 Version: $LATEST | ||
,2019-03-12T15:09:45.644Z ff316ab5-4c16-47b4-be44-079ce5968761 entered function | ||
,END RequestId: ff316ab5-4c16-47b4-be44-079ce5968761 | ||
,REPORT RequestId: ff316ab5-4c16-47b4-be44-079ce5968761 Duration: 0.64 ms Billed Duration: 100 ms Memory Size: 1536 MB Max Memory Used: 77 MB | ||
,START RequestId: 5c65450e-1558-4550-ba12-d8f1d879f0cb Version: $LATEST | ||
,2019-03-12T15:09:46.068Z 5c65450e-1558-4550-ba12-d8f1d879f0cb entered function | ||
,END RequestId: 5c65450e-1558-4550-ba12-d8f1d879f0cb | ||
,REPORT RequestId: 5c65450e-1558-4550-ba12-d8f1d879f0cb Duration: 0.50 ms Billed Duration: 100 ms Memory Size: 1536 MB Max Memory Used: 77 MB | ||
,START RequestId: 9ddb9717-1570-433e-bb06-9e0c3c4fefac Version: $LATEST | ||
`, | ||
`START RequestId: 9ddb9717-1570-433e-bb06-9e0c3c4fefac Version: $LATEST | ||
,2019-03-12T15:08:49.840Z 9ddb9717-1570-433e-bb06-9e0c3c4fefac {"errorMessage":"Cannot find module 'nodemailer'","errorType":"Error","stackTrace":["Function.Module._resolveFilename (module.js:547:15)","Function.Module._load (module.js:474:25)","Module.require (module.js:596:17)","require (internal/module.js:11:18)","Object.<anonymous> (/var/task/src/mailer/index.js:37:18)","Module._compile (module.js:652:30)","Object.Module._extensions..js (module.js:663:10)","Module.load (module.js:565:32)","tryModuleLoad (module.js:505:12)","Function.Module._load (module.js:497:3)"]} | ||
,END RequestId: 9ddb9717-1570-433e-bb06-9e0c3c4fefac | ||
,REPORT RequestId: 9ddb9717-1570-433e-bb06-9e0c3c4fefac Duration: 1.23 ms Billed Duration: 100 ms Memory Size: 1536 MB Max Memory Used: 77 MB | ||
,START RequestId: 60594137-ec13-4470-a85d-61e29cc184e2 Version: $LATEST | ||
,2019-03-12T15:09:39.835Z 60594137-ec13-4470-a85d-61e29cc184e2 entered function | ||
,END RequestId: 60594137-ec13-4470-a85d-61e29cc184e2 | ||
,REPORT RequestId: 60594137-ec13-4470-a85d-61e29cc184e2 Duration: 21.12 ms Billed Duration: 100 ms Memory Size: 1536 MB Max Memory Used: 77 MB | ||
,START RequestId: ff316ab5-4c16-47b4-be44-079ce5968761 Version: $LATEST | ||
,2019-03-12T15:09:45.644Z ff316ab5-4c16-47b4-be44-079ce5968761 entered function | ||
,END RequestId: ff316ab5-4c16-47b4-be44-079ce5968761 | ||
,REPORT RequestId: ff316ab5-4c16-47b4-be44-079ce5968761 Duration: 0.64 ms Billed Duration: 100 ms Memory Size: 1536 MB Max Memory Used: 77 MB | ||
,START RequestId: 5c65450e-1558-4550-ba12-d8f1d879f0cb Version: $LATEST | ||
,2019-03-12T15:09:46.068Z 5c65450e-1558-4550-ba12-d8f1d879f0cb entered function | ||
,END RequestId: 5c65450e-1558-4550-ba12-d8f1d879f0cb | ||
,REPORT RequestId: 5c65450e-1558-4550-ba12-d8f1d879f0cb Duration: 0.50 ms Billed Duration: 100 ms Memory Size: 1536 MB Max Memory Used: 77 MB | ||
,START RequestId: 9ddb9717-1570-433e-bb06-9e0c3c4fefac Version: $LATEST | ||
`]; | ||
|
||
export default (asStory) => { | ||
asStory('Components/Logs', module, (story, { Logs, Dialog }) => { | ||
story | ||
.add('common', () => ( | ||
<Logs messages={ MESSAGES } /> | ||
)) | ||
.add('with dialog', () => ( | ||
<Dialog isOpen size="xxl" data-e2e-id="logs-dialog"> | ||
<Dialog.Header title="Logs" /> | ||
<Dialog.Body scrollable padding="none"> | ||
<Logs messages={ [...MESSAGES, ...MESSAGES] } /> | ||
</Dialog.Body> | ||
</Dialog> | ||
)); | ||
}); | ||
}; | ||
|
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,42 @@ | ||
import { createThemeTag } from '../../theme/createThemeTag'; | ||
|
||
|
||
const name = 'logs'; | ||
|
||
const [LogsContainerTag, themeLogsContainer] = createThemeTag(name, { | ||
root: { | ||
overflowX: 'auto', | ||
}, | ||
}); | ||
|
||
const [LogMessageTag, themeLogMessage] = createThemeTag(`${name}Wrapper`, ({ COLORS }) => ({ | ||
root: { | ||
fontFamily: 'Courier', | ||
color: COLORS.WHITE, | ||
fontSize: '1.4rem', | ||
lineHeight: 2, | ||
backgroundColor: '#1C252E', | ||
padding: '0 24px', | ||
cursor: 'default', | ||
|
||
'&:first-child': { | ||
paddingTop: '24px', | ||
}, | ||
|
||
'&:last-child': { | ||
paddingBottom: '24px', | ||
}, | ||
|
||
'&:hover': { | ||
backgroundColor: '#202D3B', | ||
}, | ||
}, | ||
})); | ||
|
||
const theme = { | ||
...themeLogsContainer, | ||
...themeLogMessage, | ||
}; | ||
|
||
export { LogsContainerTag, LogMessageTag, theme }; | ||
|
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,4 @@ | ||
// @flow | ||
|
||
export { Logs } from './Logs'; | ||
export { theme } from './Logs.theme'; |
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