Files
element-call/vitest.config.ts
T
Timo K.andClaude Fable 5.1 e296d88969 Keep the component's tooltips inside its root
Compound's Tooltip floats its bubble through floating-ui's FloatingPortal,
into the body: outside the element the component build confines its
stylesheet to, so a label tooltip shows as bare text at all times. An
enclosing FloatingPortal rooted at the container makes the nested portals
land inside it instead.

The call goes in an isolating wrapper there, standing in for the standalone
page's #root, so that its footer layer no longer paints above the modals.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-29 12:08:44 +02:00

68 lines
2.0 KiB
TypeScript

import { defineConfig, mergeConfig } from "vitest/config";
import { playwright } from "@vitest/browser-playwright";
import { vitePluginsConfig } from "./vite.config.ts";
import { storybookTest } from "@storybook/addon-vitest/vitest-plugin";
import path from "node:path";
import { fileURLToPath } from "node:url";
const dirname = path.dirname(fileURLToPath(import.meta.url));
export default defineConfig((configEnv) =>
mergeConfig(
vitePluginsConfig(configEnv),
defineConfig({
test: {
fileParallelism: true,
projects: [
{
extends: true,
test: {
name: "unit",
css: { include: /.+/ },
setupFiles: ["src/vitest.setup.ts"],
environment: "jsdom",
include: [
"src/**/*.test.ts",
"src/**/*.test.tsx",
"component/**/*.test.ts",
"component/**/*.test.tsx",
],
},
},
{
plugins: [
storybookTest({
// The location of your Storybook config, main.js|ts
configDir: "./.storybook",
}),
...vitePluginsConfig(configEnv).plugins!,
],
test: {
name: "storybook",
browser: {
enabled: true,
// Make sure to install Playwright
provider: playwright(),
headless: true,
instances: [{ browser: "chromium" }],
},
},
},
],
coverage: {
reporter: ["html", "json"],
include: ["src/**/*.{ts,tsx,js,jsx}"],
exclude: [
"src/**/*.md",
"src/**/*.{d,test,stories}.{ts,tsx}",
"src/utils/test.ts",
"src/utils/test-viewmodel.ts",
"src/utils/test-fixtures.ts",
"playwright/**",
],
},
},
}),
),
);