Skip to content

Commit

Permalink
fix(test): adjust selector tests to new behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
dhodgsonintergral committed Jan 2, 2025
1 parent 8b44c7c commit ecdda54
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion public/app/features/scopes/tests/selector.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import {act} from "@testing-library/react";

import { config } from '@grafana/runtime';
import { sceneGraph } from '@grafana/scenes';
import { DashboardScene } from 'app/features/dashboard-scene/scene/DashboardScene';

import {scopesSelectorScene} from "../instance";
import { getClosestScopesFacade } from '../utils';

import { applyScopes, cancelScopes, openSelector, selectResultCloud, updateScopes } from './utils/actions';
Expand All @@ -22,12 +25,20 @@ describe('Selector', () => {
let dashboardScene: DashboardScene;

beforeAll(() => {
config.featureToggles.singleTopNav = true;
config.featureToggles.scopeFilters = true;
config.featureToggles.groupByVariable = true;
});

beforeEach(() => {
beforeEach(async () => {
dashboardScene = renderDashboard();
// Enable the scope selector
scopesSelectorScene?.enable();

await act(async () => {
await scopesSelectorScene?.fetchBaseNodes();
await new Promise(resolve => setTimeout(resolve, 0));
});
});

afterEach(async () => {
Expand Down

0 comments on commit ecdda54

Please sign in to comment.