Updated to airbnb coding styles

This commit is contained in:
Alejandro Celaya
2022-03-26 12:17:42 +01:00
parent 4e9b19afd1
commit a2df486280
239 changed files with 2210 additions and 3549 deletions

View File

@@ -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);