From 25a6855df35e974e68632e52d4608f4e0f5469c1 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Thu, 13 Jun 2024 17:22:55 +0200 Subject: [PATCH] tests: Fix cypress config to resolve Vue with runtime compiler Signed-off-by: Ferdinand Thiessen --- build/l10n-plugin.mts | 2 +- cypress.config.ts | 11 ++++++++++- cypress/visual/AppNavigationItem.cy.ts | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/build/l10n-plugin.mts b/build/l10n-plugin.mts index d310f8eb..99d0d03a 100644 --- a/build/l10n-plugin.mts +++ b/build/l10n-plugin.mts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ -import { Plugin } from 'vite' +import type { Plugin } from 'vite' import { loadTranslations } from './translations.mts' import { dirname, resolve } from 'path' diff --git a/cypress.config.ts b/cypress.config.ts index cefa5f26..0ad632c6 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: CC0-1.0 */ import { defineConfig } from 'cypress' -import { configureVisualRegression } from 'cypress-visual-regression' +import { configureVisualRegression } from 'cypress-visual-regression/dist/plugin' export default defineConfig({ projectId: '3paxvy', @@ -48,6 +48,15 @@ export default defineConfig({ devServer: { framework: 'vue', bundler: 'vite', + viteConfig: { + configFile: 'vite.config.ts', + // Ensure we use the runtime compiler of vue + resolve: { + alias: { + vue: 'vue/dist/vue.esm-bundler.js', + }, + }, + }, }, }, }) diff --git a/cypress/visual/AppNavigationItem.cy.ts b/cypress/visual/AppNavigationItem.cy.ts index cfdcba2e..0658532b 100644 --- a/cypress/visual/AppNavigationItem.cy.ts +++ b/cypress/visual/AppNavigationItem.cy.ts @@ -4,7 +4,7 @@ */ import { mount } from 'cypress/vue' import { defineComponent } from 'vue' -import { createRouter, createMemoryHistory} from 'vue-router' +import { createRouter, createMemoryHistory } from 'vue-router' import NcAppNavigationItem from '../../src/components/NcAppNavigationItem/NcAppNavigationItem.vue' @@ -37,7 +37,7 @@ describe('NcAppNavigationItem', () => { }) }) - it('has tertiary styling on non active route', () => { + it.only('has tertiary styling on non active route', () => { cy.contains('.app-navigation-entry', 'Foo').compareSnapshot('NcAppNavigationItem-tertiary-non-active-route') })