fix(native-filters): Fix indicators (#14334)

* fix:fix get permission function

* fix: hide featured filters

* test: fix FF in tests

* test: fix FF in tests

* fix: fix unset cross filters
This commit is contained in:
simcha90
2021-04-26 13:22:11 +03:00
committed by GitHub
parent b8356a64ee
commit 7ff35dfdfb
2 changed files with 65 additions and 50 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 { FeatureFlag } from 'src/featureFlags';
describe('FiltersBadge', () => {
// there's this bizarre "active filters" thing
@@ -158,6 +159,10 @@ describe('FiltersBadge', () => {
});
it('shows the indicator when filters have been applied', () => {
// @ts-ignore
global.featureFlags = {
[FeatureFlag.DASHBOARD_NATIVE_FILTERS]: true,
};
const store = getMockStoreWithNativeFilters();
// start with basic dashboard state, dispatch an event to simulate query completion
store.dispatch({
@@ -182,6 +187,10 @@ describe('FiltersBadge', () => {
});
it("shows a warning when there's a rejected filter", () => {
// @ts-ignore
global.featureFlags = {
[FeatureFlag.DASHBOARD_NATIVE_FILTERS]: true,
};
const store = getMockStoreWithNativeFilters();
// start with basic dashboard state, dispatch an event to simulate query completion
store.dispatch({