Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegIvaniv committed Jan 6, 2025
1 parent e5cdfd5 commit 14b2851
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/editor-ui/src/stores/ui.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export const useUIStore = defineStore(STORES.UI, () => {
// Keep track of the preferred theme and update it when the system preference changes
const preferredTheme = getPreferredTheme();
const preferredSystemTheme = ref<AppliedThemeOption>(preferredTheme.theme);
preferredTheme.mediaQuery.addEventListener('change', () => {
preferredTheme.mediaQuery?.addEventListener('change', () => {
preferredSystemTheme.value = getPreferredTheme().theme;
});

Expand Down
2 changes: 1 addition & 1 deletion packages/editor-ui/src/stores/ui.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function getPreferredTheme(): { theme: AppliedThemeOption; mediaQuery: Me
const isDarkModeQuery = !!window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)');

return {
theme: isDarkModeQuery.matches ? 'dark' : 'light',
theme: isDarkModeQuery?.matches ? 'dark' : 'light',
mediaQuery: isDarkModeQuery,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe('TestDefinitionListView', () => {
testDefinitionStore.startTestRun = startTestRunMock;
testDefinitionStore.fetchTestRuns = fetchTestRunsMock;
testDefinitionStore.deleteById = deleteByIdMock;
testDefinitionStore.allTestDefinitionsByWorkflowId = vi.fn().mockReturnValue(testDefinitions);
testDefinitionStore.allTestDefinitionsByWorkflowId = { workflow1: testDefinitions };

const component = renderComponent({ pinia });
await waitAllPromises();
Expand Down

0 comments on commit 14b2851

Please sign in to comment.