Migrates Label component from Bootstrap to AntD. (#12774)

This commit is contained in:
Michael S. Molina
2021-02-02 03:15:07 -03:00
committed by GitHub
parent 388edbf7b2
commit 2adfb85597
21 changed files with 162 additions and 225 deletions

View File

@@ -19,7 +19,7 @@
import React from 'react';
import { styledMount as mount } from 'spec/helpers/theming';
import Security from 'src/profile/components/Security';
import Label from 'src/components/Label';
import { user, userNoPerms } from './fixtures';
describe('Security', () => {
@@ -31,19 +31,19 @@ describe('Security', () => {
});
it('renders 2 role labels', () => {
const wrapper = mount(<Security {...mockedProps} />);
expect(wrapper.find('.roles').find('.label')).toHaveLength(2);
expect(wrapper.find('.roles').find(Label)).toHaveLength(2);
});
it('renders 2 datasource labels', () => {
const wrapper = mount(<Security {...mockedProps} />);
expect(wrapper.find('.datasources').find('.label')).toHaveLength(2);
expect(wrapper.find('.datasources').find(Label)).toHaveLength(2);
});
it('renders 3 database labels', () => {
const wrapper = mount(<Security {...mockedProps} />);
expect(wrapper.find('.databases').find('.label')).toHaveLength(3);
expect(wrapper.find('.databases').find(Label)).toHaveLength(3);
});
it('renders no permission label when empty', () => {
const wrapper = mount(<Security user={userNoPerms} />);
expect(wrapper.find('.datasources').find('.label')).not.toExist();
expect(wrapper.find('.databases').find('.label')).not.toExist();
expect(wrapper.find('.datasources').find(Label)).not.toExist();
expect(wrapper.find('.databases').find(Label)).not.toExist();
});
});