-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"name": "@doist/reactist", | ||
"description": "Open source React components by Doist", | ||
"author": "Henning Muszynski <[email protected]> (http://doist.com)", | ||
"version": "9.0.0", | ||
"version": "9.1.0", | ||
"license": "MIT", | ||
"homepage": "https://github.com/Doist/reactist#readme", | ||
"repository": "git+https://github.com/Doist/reactist.git", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,31 @@ | ||
import React from 'react' | ||
import { shallow } from 'enzyme' | ||
import { render, screen } from '@testing-library/react' | ||
|
||
import { Loading } from './loading' | ||
|
||
describe('Loading', () => { | ||
it('renders a loading indicator', () => { | ||
const loading = shallow(<Loading />) | ||
expect(loading).toMatchSnapshot() | ||
render(<Loading />) | ||
expect(screen.getByRole('alert', { name: 'Loading' })).toBeVisible() | ||
}) | ||
|
||
it('adds accessibility attributes', () => { | ||
render(<Loading />) | ||
|
||
const loading = screen.getByRole('alert', { name: 'Loading' }) | ||
expect(loading).toHaveAttribute('aria-live', 'assertive') | ||
}) | ||
|
||
it('allows for custom aria labels', () => { | ||
render(<Loading aria-label="Your content is now loading" />) | ||
|
||
expect(screen.getByRole('alert', { name: 'Your content is now loading' })).toBeVisible() | ||
}) | ||
|
||
it('adds additionally supplied className', () => { | ||
const loading = shallow(<Loading className="additional className" />) | ||
expect(loading.hasClass('additional')).toBe(true) | ||
expect(loading.hasClass('className')).toBe(true) | ||
render(<Loading className="additional className" />) | ||
|
||
const loading = screen.getByRole('alert', { name: 'Loading' }) | ||
expect(loading).toHaveClass('additional', 'className') | ||
}) | ||
}) |
This file was deleted.