Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 6 additions & 3 deletions src/popup/__tests__/App.integration.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,14 @@ describe('Popup App Integration', () => {

const renderPopup = async () => {
const { SessionProvider } = await import('../../contexts/SessionContext');
const { ThemeProvider } = await import('../../contexts/ThemeContext');
await act(async () => {
render(
<SessionProvider>
<App />
</SessionProvider>
<ThemeProvider>
<SessionProvider>
Comment on lines +130 to +134

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge ThemeProvider render helper still breaks popup tests

Wrapping renderPopup in ThemeProvider fixes the missing context, but the test’s mocked storage still lacks getSetting/saveSetting while ThemeProvider calls both on mount (see ThemeContext.loadTheme at src/contexts/ThemeContext.tsx:41-71). When this render helper runs, those undefined mocks throw a TypeError before any assertions execute, so the integration suite will remain red. Add stubs for the theme storage methods or mock ThemeProvider itself to unblock the tests.

Useful? React with 👍 / 👎.

<App />
</SessionProvider>
</ThemeProvider>
);
});
};
Expand Down
9 changes: 6 additions & 3 deletions src/sidepanel/__tests__/App.integration.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,14 @@ describe('Sidepanel App Integration', () => {

const renderSidepanel = async () => {
const { SessionProvider } = await import('../../contexts/SessionContext');
const { ThemeProvider } = await import('../../contexts/ThemeContext');
await act(async () => {
render(
<SessionProvider>
<App />
</SessionProvider>
<ThemeProvider>
Comment on lines 177 to +181

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Sidepanel render helper now triggers missing storage mocks

The new ThemeProvider wrapper in renderSidepanel executes ThemeContext.loadTheme, which calls storage.getSetting/saveSetting (src/contexts/ThemeContext.tsx:41-71). The sidepanel test’s storage mock only defines session/bookmark helpers, so rendering now throws getSetting is not a function, preventing the updated tests from passing. Add mocks for the theme setting methods or avoid mounting ThemeProvider in this helper.

Useful? React with 👍 / 👎.

<SessionProvider>
<App />
</SessionProvider>
</ThemeProvider>
);
});
};
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default defineConfig({
plugins: [react(), copyStaticFiles()],
build: {
outDir: 'dist',
sourcemap: true,
sourcemap: process.env.NODE_ENV !== 'production',
minify: 'esbuild',
target: 'es2020',
rollupOptions: {
Expand Down
2 changes: 1 addition & 1 deletion vite.content.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { resolve } from 'path';
export default defineConfig({
build: {
outDir: 'dist',
sourcemap: true,
sourcemap: process.env.NODE_ENV !== 'production',
minify: 'esbuild',
target: 'es2020',
emptyOutDir: false, // Don't clear the dist folder (main build already created it)
Expand Down
Loading