Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions ui/components/survey/feedback-survey.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ const provideSurveys = (surveys: Survey[]): void => {
});
};

const renderSurvey = async () => {
// Pre-evaluating the lazy chunk keeps findBy* queries from racing module
// evaluation under full-suite load; guard tests that assert the chunk is never
// touched opt out via preloadRuntime: false.
const renderSurvey = async ({ preloadRuntime = true } = {}) => {
if (preloadRuntime) await import("./runtime-feedback-survey");
const { FeedbackSurvey } = await import("./feedback-survey");
return render(<FeedbackSurvey />);
};
Expand Down Expand Up @@ -475,7 +479,7 @@ describe("FeedbackSurvey", () => {
});

// When
const view = await renderSurvey();
const view = await renderSurvey({ preloadRuntime: false });

// Then - no init, no survey fetch, nothing rendered
expect(mocks.init).not.toHaveBeenCalled();
Expand All @@ -495,7 +499,7 @@ describe("FeedbackSurvey", () => {
});

// When
const view = await renderSurvey();
const view = await renderSurvey({ preloadRuntime: false });

// Then
expect(view.container).toBeEmptyDOMElement();
Expand All @@ -515,7 +519,7 @@ describe("FeedbackSurvey", () => {
provideSurveys([SURVEY_FIXTURE]);

// When
const view = await renderSurvey();
const view = await renderSurvey({ preloadRuntime: false });

// Then - no init, no trigger, no survey fetch, no capture, regardless of config
expect(view.container).toBeEmptyDOMElement();
Expand Down
Loading