-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(fuselage):
MessageSystem
time fontScale (#1280)
- Loading branch information
1 parent
dec9be9
commit 8b8d43b
Showing
5 changed files
with
366 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@rocket.chat/fuselage": patch | ||
--- | ||
|
||
fix(fuselage): MessageSystem time fontScale |
55 changes: 25 additions & 30 deletions
55
packages/fuselage/src/components/Message/MessageSystem/MessageSystem.spec.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 |
---|---|---|
@@ -1,34 +1,29 @@ | ||
import { composeStories } from '@storybook/testing-react'; | ||
import { render } from '@testing-library/react'; | ||
import { axe } from 'jest-axe'; | ||
import React from 'react'; | ||
|
||
import { | ||
MessageSystem, | ||
MessageSystemLeftContainer, | ||
MessageSystemContainer, | ||
MessageSystemBlock, | ||
MessageSystemName, | ||
MessageSystemBody, | ||
MessageSystemTimestamp, | ||
} from '.'; | ||
import * as stories from './MessageSystem.stories'; | ||
|
||
it('renders without crashing', () => { | ||
render( | ||
<MessageSystem> | ||
<MessageSystemLeftContainer /> | ||
<MessageSystemContainer> | ||
<MessageSystemBlock> | ||
<MessageSystemName>Haylie George</MessageSystemName> | ||
<MessageSystemBody> | ||
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris | ||
nisi ut aliquip ex ea commodo consequat a duis aute irure dolor in | ||
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla | ||
pariatur. Consectetur adipiscing elit, sed do eiusmod tempor | ||
incididunt ut labore et dolore magna aliqua. Ut enim ad minim | ||
veniam... | ||
</MessageSystemBody> | ||
<MessageSystemTimestamp>12:00 PM</MessageSystemTimestamp> | ||
</MessageSystemBlock> | ||
</MessageSystemContainer> | ||
</MessageSystem> | ||
); | ||
}); | ||
const testCases = Object.values(composeStories(stories)).map((Story) => [ | ||
Story.storyName || 'Story', | ||
Story, | ||
]); | ||
|
||
test.each(testCases)( | ||
`renders %s without crashing`, | ||
async (_storyname, Story) => { | ||
const tree = render(<Story />); | ||
expect(tree.baseElement).toMatchSnapshot(); | ||
} | ||
); | ||
|
||
test.each(testCases)( | ||
'%s should have no a11y violations', | ||
async (_storyname, Story) => { | ||
const { container } = render(<Story />); | ||
|
||
const results = await axe(container); | ||
expect(results).toHaveNoViolations(); | ||
} | ||
); |
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
Oops, something went wrong.