-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into dependabot/npm_and_yarn/execa-8.0.1
- Loading branch information
Showing
258 changed files
with
5,822 additions
and
5,321 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,11 @@ | ||
--- | ||
'@talend/react-faceted-search': minor | ||
'@talend/design-system': minor | ||
'@talend/react-bootstrap': minor | ||
'@talend/react-components': minor | ||
'@talend/react-containers': minor | ||
'@talend/react-forms': minor | ||
'@talend/react-a11y': minor | ||
--- | ||
|
||
Remove usage of lib keyCode |
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 @@ | ||
--- | ||
'@talend/react-components': patch | ||
--- | ||
|
||
fix: security issue on regexp |
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 @@ | ||
--- | ||
'@talend/scripts-config-jest': major | ||
--- | ||
|
||
chore: bump testing-library to 6.x |
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,7 @@ | ||
--- | ||
'@talend/react-cmf': patch | ||
--- | ||
|
||
fix: withoutHOC regex | ||
|
||
report says Polynomial regular expression used on uncontrolled data |
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,92 +1,95 @@ | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import userEvent from '@testing-library/user-event'; | ||
|
||
import Alert from './Alert'; | ||
|
||
describe('<Alert>', () => { | ||
it('Should output a alert with message', () => { | ||
// when | ||
render( | ||
<Alert> | ||
<strong>Message</strong> | ||
</Alert> | ||
); | ||
|
||
// then | ||
expect(screen.getByRole('alert')).toBeInTheDocument(); | ||
expect(screen.getByText('Message')).toBeInTheDocument(); | ||
}); | ||
|
||
it('Should have bsType by default', () => { | ||
// when | ||
render( | ||
<Alert> | ||
<strong>Message</strong> | ||
</Alert> | ||
); | ||
|
||
// then | ||
expect(screen.getByRole('alert')).toHaveClass('alert-info'); | ||
}); | ||
|
||
it('Should have dismissable style with onDismiss', () => { | ||
// when | ||
render( | ||
<Alert onDismiss={jest.fn()}> | ||
<strong>Message</strong> | ||
</Alert> | ||
); | ||
|
||
// then | ||
expect(screen.getByRole('alert')).toHaveClass('alert-dismissable'); | ||
}); | ||
|
||
it('Should call onDismiss callback on dismiss click', () => { | ||
// given | ||
const onDismiss = jest.fn(); | ||
render( | ||
<Alert onDismiss={onDismiss} closeLabel="close"> | ||
<strong>Message</strong> | ||
</Alert> | ||
); | ||
expect(onDismiss).not.toBeCalled(); | ||
|
||
// when | ||
userEvent.click(screen.getByRole('button', { name: 'close' })); | ||
|
||
// then | ||
expect(onDismiss).toBeCalled(); | ||
}); | ||
|
||
it('Should have a default bsStyle class', () => { | ||
// when | ||
render(<Alert>Message</Alert>); | ||
|
||
// then | ||
expect(screen.getByRole('alert')).toHaveClass('alert-info'); | ||
}); | ||
|
||
it('Should have use bsStyle class', () => { | ||
// when | ||
render(<Alert bsStyle="danger">Message</Alert>); | ||
|
||
// then | ||
expect(screen.getByRole('alert')).toHaveClass('alert-danger'); | ||
}); | ||
|
||
describe('Web Accessibility', () => { | ||
it('Should call onDismiss callback when the sr-only dismiss link is activated', () => { | ||
// given | ||
const onDismiss = jest.fn(); | ||
render(<Alert onDismiss={onDismiss}>Message</Alert>); | ||
expect(onDismiss).not.toBeCalled(); | ||
|
||
// when | ||
userEvent.click(screen.getByRole('button', { name: 'Close alert' })); | ||
|
||
// then | ||
expect(onDismiss).toBeCalled(); | ||
}); | ||
}); | ||
it('Should output a alert with message', () => { | ||
// when | ||
render( | ||
<Alert> | ||
<strong>Message</strong> | ||
</Alert>, | ||
); | ||
|
||
// then | ||
expect(screen.getByRole('alert')).toBeInTheDocument(); | ||
expect(screen.getByText('Message')).toBeInTheDocument(); | ||
}); | ||
|
||
it('Should have bsType by default', () => { | ||
// when | ||
render( | ||
<Alert> | ||
<strong>Message</strong> | ||
</Alert>, | ||
); | ||
|
||
// then | ||
expect(screen.getByRole('alert')).toHaveClass('alert-info'); | ||
}); | ||
|
||
it('Should have dismissable style with onDismiss', () => { | ||
// when | ||
render( | ||
<Alert onDismiss={jest.fn()}> | ||
<strong>Message</strong> | ||
</Alert>, | ||
); | ||
|
||
// then | ||
expect(screen.getByRole('alert')).toHaveClass('alert-dismissable'); | ||
}); | ||
|
||
it('Should call onDismiss callback on dismiss click', async () => { | ||
const user = userEvent.setup(); | ||
|
||
// given | ||
const onDismiss = jest.fn(); | ||
render( | ||
<Alert onDismiss={onDismiss} closeLabel="close"> | ||
<strong>Message</strong> | ||
</Alert>, | ||
); | ||
expect(onDismiss).not.toHaveBeenCalled(); | ||
|
||
// when | ||
await user.click(screen.getByRole('button', { name: 'close' })); | ||
|
||
// then | ||
expect(onDismiss).toHaveBeenCalled(); | ||
}); | ||
|
||
it('Should have a default bsStyle class', () => { | ||
// when | ||
render(<Alert>Message</Alert>); | ||
|
||
// then | ||
expect(screen.getByRole('alert')).toHaveClass('alert-info'); | ||
}); | ||
|
||
it('Should have use bsStyle class', () => { | ||
// when | ||
render(<Alert bsStyle="danger">Message</Alert>); | ||
|
||
// then | ||
expect(screen.getByRole('alert')).toHaveClass('alert-danger'); | ||
}); | ||
|
||
describe('Web Accessibility', () => { | ||
it('Should call onDismiss callback when the sr-only dismiss link is activated', async () => { | ||
const user = userEvent.setup(); | ||
|
||
// given | ||
const onDismiss = jest.fn(); | ||
render(<Alert onDismiss={onDismiss}>Message</Alert>); | ||
expect(onDismiss).not.toHaveBeenCalled(); | ||
|
||
// when | ||
await user.click(screen.getByRole('button', { name: 'Close alert' })); | ||
|
||
// then | ||
expect(onDismiss).toHaveBeenCalled(); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.