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
23 changes: 23 additions & 0 deletions .storybook/test-runner.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import type { TestRunnerConfig } from '@storybook/test-runner';

// Extend Window interface to include __test property
// Note: This variable is referenced in test-runner's page.evaluate calls
// but not directly in our codebase. It appears to be expected by the test environment.
declare global {
interface Window {
__test?: boolean;
}
}

const config: TestRunnerConfig = {
async preVisit(page) {
// Inject __test global to prevent ReferenceError during test execution
// This addresses the error: "page.evaluate: ReferenceError: __test is not defined"
// that occurs when running Storybook test-runner smoke tests
await page.evaluate(() => {
window.__test = true;
});
},
};

export default config;
Loading