feat: Dynamic imports for the Icons component (#14318)

* Add aria-label and twotone

* Enhance LazyIcon

* Fix tests and solve ject warnings

* Add new line

* Revert package-lock to master

* Fix failing test

* Implement icon overrides

* Fix failing storybook

* Clean up

* Improve var name
This commit is contained in:
Geido
2021-04-29 21:49:39 +03:00
committed by GitHub
parent a2831382a9
commit 545e257537
21 changed files with 333 additions and 396 deletions

View File

@@ -31,6 +31,7 @@ import {
import { sliceId } from 'spec/fixtures/mockChartQueries';
import { dashboardFilters } from 'spec/fixtures/mockDashboardFilters';
import { dashboardWithFilter } from 'spec/fixtures/mockDashboardLayout';
import Icons from 'src/components/Icons';
import { FeatureFlag } from 'src/featureFlags';
describe('FiltersBadge', () => {
@@ -129,7 +130,7 @@ describe('FiltersBadge', () => {
).toHaveText('1');
// to look at the shape of the wrapper use:
// console.log(wrapper.dive().debug())
expect(wrapper.dive().find('Icon[name="alert-solid"]')).toExist();
expect(wrapper.dive().find(Icons.AlertSolid)).toExist();
});
});
@@ -216,7 +217,7 @@ describe('FiltersBadge', () => {
expect(
wrapper.dive().find('[data-test="incompatible-filter-count"]'),
).toHaveText('1');
expect(wrapper.dive().find('Icon[name="alert-solid"]')).toExist();
expect(wrapper.dive().find(Icons.AlertSolid)).toExist();
});
});
});