-
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.
feat(fuselage): new
InputBox
small variant (#1377)
- Loading branch information
1 parent
08ff9b3
commit a4f8bb5
Showing
33 changed files
with
867 additions
and
241 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": minor | ||
--- | ||
|
||
feat(fuselage): new `InputBox` small variant |
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
14 changes: 14 additions & 0 deletions
14
packages/fuselage/src/components/EmailInput/__snapshots__/EmailInput.spec.tsx.snap
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,14 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`[EmailInput Component] renders without crashing 1`] = ` | ||
<body> | ||
<div> | ||
<input | ||
aria-label="email" | ||
class="rcx-box rcx-box--full rcx-box--animated rcx-input-box--type-email rcx-input-box" | ||
size="1" | ||
type="email" | ||
/> | ||
</div> | ||
</body> | ||
`; |
18 changes: 13 additions & 5 deletions
18
packages/fuselage/src/components/InputBox/InputBox.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,14 +1,22 @@ | ||
import { composeStories } from '@storybook/testing-react'; | ||
import { render } from '@testing-library/react'; | ||
import { axe } from 'jest-axe'; | ||
import React from 'react'; | ||
|
||
import { InputBox } from '.'; | ||
import * as stories from './InputBox.stories'; | ||
|
||
const { Default } = composeStories(stories); | ||
|
||
describe('[InputBox Component]', () => { | ||
it('renders InputBox without crashing', () => { | ||
render(<InputBox type='text' />); | ||
it('renders without crashing', () => { | ||
const tree = render(<Default />); | ||
expect(tree.baseElement).toMatchSnapshot(); | ||
}); | ||
|
||
it('renders InputBox.Skeleton without crashing', () => { | ||
render(<InputBox.Skeleton />); | ||
it('%s should have no a11y violations', async () => { | ||
const { container } = render(<Default />); | ||
|
||
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
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
15 changes: 15 additions & 0 deletions
15
packages/fuselage/src/components/InputBox/__snapshots__/InputBox.spec.tsx.snap
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 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`[InputBox Component] renders without crashing 1`] = ` | ||
<body> | ||
<div> | ||
<input | ||
aria-label="Value" | ||
class="rcx-box rcx-box--full rcx-box--animated rcx-input-box--type-text rcx-input-box" | ||
size="1" | ||
type="text" | ||
value="Value" | ||
/> | ||
</div> | ||
</body> | ||
`; |
16 changes: 14 additions & 2 deletions
16
packages/fuselage/src/components/NumberInput/NumberInput.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,10 +1,22 @@ | ||
import { composeStories } from '@storybook/testing-react'; | ||
import { render } from '@testing-library/react'; | ||
import { axe } from 'jest-axe'; | ||
import React from 'react'; | ||
|
||
import { NumberInput } from '.'; | ||
import * as stories from './NumberInput.stories'; | ||
|
||
const { Default } = composeStories(stories); | ||
|
||
describe('[NumberInput Component]', () => { | ||
it('renders without crashing', () => { | ||
render(<NumberInput />); | ||
const tree = render(<Default />); | ||
expect(tree.baseElement).toMatchSnapshot(); | ||
}); | ||
|
||
it('%s should have no a11y violations', async () => { | ||
const { container } = render(<Default />); | ||
|
||
const results = await axe(container); | ||
expect(results).toHaveNoViolations(); | ||
}); | ||
}); |
Oops, something went wrong.