From a946e2e3924739eafdc869f91678cfde0ea8ee25 Mon Sep 17 00:00:00 2001 From: Marthym Date: Tue, 27 Aug 2024 22:56:55 +0200 Subject: [PATCH] ci(main): test include front coverage to sonar --- pom.xml | 15 ++- seaside/.gitignore | 6 +- seaside/package.json | 4 +- seaside/pom.xml | 15 ++- .../components/feedslist/FeedEditor.vue | 12 +- .../components/profile/ProfileTab.vue | 2 +- .../components/sidenav/SideNavFilters.vue | 22 ++-- seaside/src/security/pages/LoginPage.vue | 2 +- seaside/src/teams/components/TeamEditor.vue | 2 +- seaside/src/techwatch/services/TagsService.ts | 37 +++--- .../component/UserAdminTab.test.ts | 32 +++++ .../page/AdministrationPage.test.ts | 48 ++++++++ .../common/components/BaywatchIcon.test.ts | 11 ++ .../components/FileUploadWindow.test.ts | 22 ++++ .../components/SettingsTabVue.test.ts | 14 +++ .../components/feedslist/FeedEditor.test.ts | 39 ++++++ .../components/feedslist/FeedsList.test.ts | 47 ++++++++ .../profile/ChangePasswordModal.test.ts | 23 ++++ .../components/profile/ProfileTab.test.ts | 34 ++++++ .../unit/security/pages/LoginPage.test.ts | 31 +++++ .../unit/teams/components/TeamEditor.test.ts | 51 ++++++++ .../tests/unit/teams/pages/TeamsPage.test.ts | 38 ++++++ seaside/tsconfig.json | 2 +- seaside/vitest.config.ts | 4 + seaside/yarn.lock | 111 +++++++++++++++++- sonar-project.properties | 10 +- 26 files changed, 582 insertions(+), 52 deletions(-) create mode 100644 seaside/tests/unit/administration/component/UserAdminTab.test.ts create mode 100644 seaside/tests/unit/administration/page/AdministrationPage.test.ts create mode 100644 seaside/tests/unit/common/components/BaywatchIcon.test.ts create mode 100644 seaside/tests/unit/common/components/FileUploadWindow.test.ts create mode 100644 seaside/tests/unit/configuration/components/feedslist/FeedEditor.test.ts create mode 100644 seaside/tests/unit/configuration/components/feedslist/FeedsList.test.ts create mode 100644 seaside/tests/unit/configuration/components/profile/ChangePasswordModal.test.ts create mode 100644 seaside/tests/unit/configuration/components/profile/ProfileTab.test.ts create mode 100644 seaside/tests/unit/security/pages/LoginPage.test.ts create mode 100644 seaside/tests/unit/teams/components/TeamEditor.test.ts create mode 100644 seaside/tests/unit/teams/pages/TeamsPage.test.ts diff --git a/pom.xml b/pom.xml index f8dec1c2..f24b03ad 100644 --- a/pom.xml +++ b/pom.xml @@ -132,8 +132,19 @@ https://sonarcloud.io ${project.groupId}:${project.artifactId} **/jacoco.xml - **/*.html - **/*.html + **/lcov.info + + + **/*.html, + **/*.test.*, + **/locales/**, + ${project.basedir}/seaside/dist/** + + + **/*.html, + **/locales/**, + **/dist/** + ${project.build.directory}/classes ${project.build.directory}/dependency diff --git a/seaside/.gitignore b/seaside/.gitignore index c3e43efd..6b7a9e2e 100644 --- a/seaside/.gitignore +++ b/seaside/.gitignore @@ -1,8 +1,8 @@ .DS_Store node_modules -/dist -/coverage - +dist +coverage +.scannerwork # local env files .env.local diff --git a/seaside/package.json b/seaside/package.json index 81b4256e..f28a772b 100644 --- a/seaside/package.json +++ b/seaside/package.json @@ -8,7 +8,8 @@ "dev": "vite", "lint": "eslint --fix --ext .js,.vue --ignore-path .gitignore src", "preview": "vite preview", - "test": "vitest" + "test": "vitest", + "coverage": "vitest run --coverage" }, "dependencies": { "@heroicons/vue": "2.1.5", @@ -30,6 +31,7 @@ "@typescript-eslint/eslint-plugin": "8.0.1", "@typescript-eslint/parser": "8.0.1", "@vitejs/plugin-vue": "5.1.2", + "@vitest/coverage-v8": "2.0.5", "@vue/test-utils": "2.4.6", "autoprefixer": "10.4.20", "eslint": "9.9.0", diff --git a/seaside/pom.xml b/seaside/pom.xml index 4c78a235..511f14ac 100644 --- a/seaside/pom.xml +++ b/seaside/pom.xml @@ -110,7 +110,7 @@ - Webpack build + Vite build generate-resources yarn @@ -122,6 +122,19 @@ exec + + Vitest Coverage + generate-resources + + yarn + + coverage + + + + exec + + diff --git a/seaside/src/configuration/components/feedslist/FeedEditor.vue b/seaside/src/configuration/components/feedslist/FeedEditor.vue index 4020fcac..faafa6c6 100644 --- a/seaside/src/configuration/components/feedslist/FeedEditor.vue +++ b/seaside/src/configuration/components/feedslist/FeedEditor.vue @@ -14,7 +14,8 @@ {{ t('config.feeds.editor.form.name') }}