mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
Migrates Label component from Bootstrap to AntD. (#12774)
This commit is contained in:
committed by
GitHub
parent
388edbf7b2
commit
2adfb85597
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user