-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop'
- Loading branch information
Showing
103 changed files
with
5,375 additions
and
717 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
import { ToastBar } from '@rocket.chat/fuselage'; | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { composeStories } from '@storybook/testing-react'; | ||
import { render } from '@testing-library/react'; | ||
|
||
it('renders without crashing', () => { | ||
const div = document.createElement('div'); | ||
ReactDOM.render(<ToastBar />, div); | ||
ReactDOM.unmountComponentAtNode(div); | ||
import * as stories from './stories'; | ||
|
||
const { ToastBarWithData } = composeStories(stories); | ||
|
||
describe('[ToastBarWithData Component]', () => { | ||
it('renders without crashing', () => { | ||
render(<ToastBarWithData />); | ||
}); | ||
}); |
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
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,13 +1,44 @@ | ||
import { composeStories } from '@storybook/testing-react'; | ||
import { render } from '@testing-library/react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import React from 'react'; | ||
|
||
import { Callout } from './Callout'; | ||
import * as stories from './Callout.stories'; | ||
|
||
const { Default } = composeStories(stories); | ||
const { Default, WithDescriptionOnly, Info, Success, Warning, Danger } = | ||
composeStories(stories); | ||
|
||
describe('[Callout Component]', () => { | ||
it('renders without crashing', () => { | ||
render(<Default />); | ||
describe('Storybook', () => { | ||
it.each([ | ||
['Default', Default], | ||
['WithDescriptionOnly', WithDescriptionOnly], | ||
['Info', Info], | ||
['Success', Success], | ||
['Warning', Warning], | ||
['Danger', Danger], | ||
])('renders %p story without crashing', (storyName, Story) => { | ||
render(<Story />); | ||
}); | ||
|
||
it.each([ | ||
['.rcx-callout--type-info', 'info', Info], | ||
['.rcx-callout--type-success', 'success', Success], | ||
['.rcx-callout--type-warning', 'warning', Warning], | ||
['.rcx-callout--type-danger', 'danger', Danger], | ||
])('should have class %p when type is %p', (className, typeName, Story) => { | ||
const { container } = render(<Story />); | ||
expect(container.querySelector(className)).toBeInTheDocument(); | ||
}); | ||
}); | ||
|
||
it('should show title when this property is passed', () => { | ||
render(<Callout title='test-title' />); | ||
screen.getByText('test-title'); | ||
}); | ||
|
||
it('should display children', () => { | ||
render(<Callout>Children</Callout>); | ||
screen.getByText('Children'); | ||
}); | ||
}); |
Oops, something went wrong.