mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-20 13:36:20 +00:00
Updated to airbnb coding styles
This commit is contained in:
@@ -15,9 +15,9 @@ describe('<Message />', () => {
|
||||
afterEach(() => wrapper?.unmount());
|
||||
|
||||
it.each([
|
||||
[ true, 1, 0 ],
|
||||
[ false, 0, 1 ],
|
||||
[ undefined, 0, 1 ],
|
||||
[true, 1, 0],
|
||||
[false, 0, 1],
|
||||
[undefined, 0, 1],
|
||||
])('renders expected classes based on width', (fullWidth, expectedFull, expectedNonFull) => {
|
||||
const wrapper = createWrapper({ fullWidth });
|
||||
|
||||
@@ -26,27 +26,27 @@ describe('<Message />', () => {
|
||||
});
|
||||
|
||||
it.each([
|
||||
[ true, 'These are the children contents' ],
|
||||
[ false, 'These are the children contents' ],
|
||||
[ true, undefined ],
|
||||
[ false, undefined ],
|
||||
[true, 'These are the children contents'],
|
||||
[false, 'These are the children contents'],
|
||||
[true, undefined],
|
||||
[false, undefined],
|
||||
])('renders expected content', (loading, children) => {
|
||||
const wrapper = createWrapper({ loading, children });
|
||||
|
||||
expect(wrapper.find(FontAwesomeIcon)).toHaveLength(loading ? 1 : 0);
|
||||
|
||||
if (loading) {
|
||||
expect(wrapper.find('span').text()).toContain(children ? children : 'Loading...');
|
||||
expect(wrapper.find('span').text()).toContain(children || 'Loading...');
|
||||
} else {
|
||||
expect(wrapper.find('span')).toHaveLength(0);
|
||||
expect(wrapper.find('h3').text()).toContain(children ? children : '');
|
||||
expect(wrapper.find('h3').text()).toContain(children || '');
|
||||
}
|
||||
});
|
||||
|
||||
it.each([
|
||||
[ 'error', 'border-danger', 'text-danger' ],
|
||||
[ 'default', '', 'text-muted' ],
|
||||
[ undefined, '', 'text-muted' ],
|
||||
['error', 'border-danger', 'text-danger'],
|
||||
['default', '', 'text-muted'],
|
||||
[undefined, '', 'text-muted'],
|
||||
])('renders proper classes based on message type', (type, expectedCardClass, expectedH3Class) => {
|
||||
const wrapper = createWrapper({ type: type as 'default' | 'error' | undefined });
|
||||
const card = wrapper.find(Card);
|
||||
|
||||
Reference in New Issue
Block a user