Compare commits
24
Commits
2f91f9c874
...
228259daf4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
228259daf4 | ||
|
|
ab74e029a9 | ||
|
|
ea3a2a7ce0 | ||
|
|
bafceab447 | ||
|
|
d8ce0efd89 | ||
|
|
22ea5b6122 | ||
|
|
8c3890635d | ||
|
|
7a28571528 | ||
|
|
35e1c91add | ||
|
|
255225f951 | ||
|
|
9ec9f1fcc4 | ||
|
|
90d73c2014 | ||
|
|
775ece8ab7 | ||
|
|
11c9dac77b | ||
|
|
f4fc88542f | ||
|
|
bca6105465 | ||
|
|
e78cdb9a49 | ||
|
|
e3991eef06 | ||
|
|
283c91e196 | ||
|
|
d16cff77cc | ||
|
|
be74e80393 | ||
|
|
df3f5d1967 | ||
|
|
56cb9c9784 | ||
|
|
8ab2166a8a |
No files matched your search
@@ -28,7 +28,7 @@ repos:
|
|||||||
stages: [ commit-msg ]
|
stages: [ commit-msg ]
|
||||||
additional_dependencies: [ '@commitlint/config-conventional' ]
|
additional_dependencies: [ '@commitlint/config-conventional' ]
|
||||||
- repo: https://github.com/pre-commit/mirrors-eslint
|
- repo: https://github.com/pre-commit/mirrors-eslint
|
||||||
rev: v10.8.1
|
rev: v10.10.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: eslint
|
- id: eslint
|
||||||
types: [ file ]
|
types: [ file ]
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ RUN npm run postinstall && npm run generate && npm run lint && npm run test:cove
|
|||||||
FROM scratch as export
|
FROM scratch as export
|
||||||
COPY --from=builder /build/coverage /
|
COPY --from=builder /build/coverage /
|
||||||
|
|
||||||
FROM amd64/nginx:1.31.3@sha256:48d15d50712293218f8e39cac166d2dc51c10d569b7223d69ca495710cda9374
|
FROM amd64/nginx:1.31.5@sha256:e9edb980c805d3c55dfbb73a88bf0340697a6643661757cf656b0d48ca118873
|
||||||
MAINTAINER Joakim Olsson <joakim@unbound.se>
|
MAINTAINER Joakim Olsson <joakim@unbound.se>
|
||||||
|
|
||||||
COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
|
COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
|
||||||
|
|||||||
@@ -14,20 +14,23 @@ const mockOrganizations = [
|
|||||||
// For now, the component is indirectly tested through useOrganizationSelector tests
|
// For now, the component is indirectly tested through useOrganizationSelector tests
|
||||||
// and manual testing shows it works correctly
|
// and manual testing shows it works correctly
|
||||||
|
|
||||||
|
// vi.mock is hoisted above the imports and the factory runs once, on the first
|
||||||
|
// import of the mocked module -- it was never re-applied per test despite sitting
|
||||||
|
// in beforeEach. vitest 5 rejects the nested call outright rather than silently
|
||||||
|
// hoisting it, so declare it where it actually executes.
|
||||||
|
vi.mock('~/composables/useOrganizationSelector', () => ({
|
||||||
|
useOrganizationSelector: () => ({
|
||||||
|
organizations: ref([mockOrganizations[0]]),
|
||||||
|
selectedOrganization: ref(mockOrganizations[0]),
|
||||||
|
selectedOrgId: ref('1'),
|
||||||
|
selectOrganization: mockSelectOrganization,
|
||||||
|
}),
|
||||||
|
}))
|
||||||
|
|
||||||
describe('OrganizationSwitcher - Single Organization', () => {
|
describe('OrganizationSwitcher - Single Organization', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
vi.resetModules()
|
vi.resetModules()
|
||||||
mockSelectOrganization.mockClear()
|
mockSelectOrganization.mockClear()
|
||||||
|
|
||||||
// Mock with single organization
|
|
||||||
vi.mock('~/composables/useOrganizationSelector', () => ({
|
|
||||||
useOrganizationSelector: () => ({
|
|
||||||
organizations: ref([mockOrganizations[0]]),
|
|
||||||
selectedOrganization: ref(mockOrganizations[0]),
|
|
||||||
selectedOrgId: ref('1'),
|
|
||||||
selectOrganization: mockSelectOrganization,
|
|
||||||
}),
|
|
||||||
}))
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should show a chip for single organization', async () => {
|
it('should show a chip for single organization', async () => {
|
||||||
|
|||||||
Generated
+594
-648
File diff suppressed because it is too large.
Load diff
+11
-11
@@ -18,13 +18,13 @@
|
|||||||
"lintfix": "eslint --fix . && npm run lint:style --fix"
|
"lintfix": "eslint --fix . && npm run lint:style --fix"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apollo/client": "3.14.1",
|
"@apollo/client": "4.3.0",
|
||||||
"@auth0/auth0-vue": "2.9.0",
|
"@auth0/auth0-vue": "2.9.0",
|
||||||
"@vue/apollo-composable": "4.2.2",
|
"@vue/apollo-composable": "4.2.2",
|
||||||
"graphql": "16.14.2",
|
"graphql": "16.14.2",
|
||||||
"graphql-ws": "6.2.1",
|
"graphql-ws": "6.2.1",
|
||||||
"nuxt": "4.5.2",
|
"nuxt": "4.5.2",
|
||||||
"vue": "3.5.41",
|
"vue": "3.5.42",
|
||||||
"vuetify-nuxt-module": "0.19.5"
|
"vuetify-nuxt-module": "0.19.5"
|
||||||
},
|
},
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
@@ -36,29 +36,29 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "21.2.2",
|
"@commitlint/cli": "21.2.2",
|
||||||
"@commitlint/config-conventional": "21.2.2",
|
"@commitlint/config-conventional": "21.2.2",
|
||||||
"@graphql-codegen/cli": "7.2.0",
|
"@graphql-codegen/cli": "7.4.1",
|
||||||
"@graphql-codegen/typed-document-node": "7.1.0",
|
"@graphql-codegen/typed-document-node": "7.1.0",
|
||||||
"@graphql-codegen/typescript": "6.1.0",
|
"@graphql-codegen/typescript": "6.1.0",
|
||||||
"@graphql-codegen/typescript-operations": "6.1.6",
|
"@graphql-codegen/typescript-operations": "6.1.6",
|
||||||
"@graphql-codegen/typescript-vue-apollo": "5.0.1",
|
"@graphql-codegen/typescript-vue-apollo": "5.0.1",
|
||||||
"@nuxt/devtools": "3.4.1",
|
"@nuxt/devtools": "3.4.2",
|
||||||
"@nuxt/eslint": "1.17.0",
|
"@nuxt/eslint": "1.17.0",
|
||||||
"@nuxtjs/stylelint-module": "5.2.1",
|
"@nuxtjs/stylelint-module": "5.2.1",
|
||||||
"@stylistic/eslint-plugin": "5.10.0",
|
"@stylistic/eslint-plugin": "5.10.0",
|
||||||
"@vitejs/plugin-vue": "6.0.8",
|
"@vitejs/plugin-vue": "6.0.8",
|
||||||
"@vitest/coverage-v8": "4.1.10",
|
"@vitest/coverage-v8": "5.0.0",
|
||||||
"@vue/test-utils": "2.4.11",
|
"@vue/test-utils": "2.5.0",
|
||||||
"eslint": "10.8.1",
|
"eslint": "10.10.0",
|
||||||
"eslint-plugin-simple-import-sort": "14.0.0",
|
"eslint-plugin-simple-import-sort": "14.0.0",
|
||||||
"eslint-plugin-vue": "10.10.0",
|
"eslint-plugin-vue": "10.11.0",
|
||||||
"jsdom": "30.0.1",
|
"jsdom": "30.0.1",
|
||||||
"postcss-html": "2.0.0",
|
"postcss-html": "2.0.0",
|
||||||
"stylelint": "17.14.1",
|
"stylelint": "17.15.0",
|
||||||
"stylelint-config-recommended-vue": "2.0.0",
|
"stylelint-config-recommended-vue": "2.0.0",
|
||||||
"stylelint-config-standard": "40.0.0",
|
"stylelint-config-standard": "40.0.0",
|
||||||
"typescript": "6.0.3",
|
"typescript": "6.0.3",
|
||||||
"typescript-eslint": "8.67.0",
|
"typescript-eslint": "8.70.0",
|
||||||
"vitest": "4.1.10",
|
"vitest": "5.0.0",
|
||||||
"vue-eslint-parser": "10.4.1"
|
"vue-eslint-parser": "10.4.1"
|
||||||
},
|
},
|
||||||
"overrides": {
|
"overrides": {
|
||||||
|
|||||||
+9
-1
@@ -31,7 +31,15 @@ class LocalStorageMock {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
global.localStorage = new LocalStorageMock() as unknown as Storage
|
// jsdom defines localStorage as a getter-only accessor on the window object, so a
|
||||||
|
// plain assignment throws ("Cannot set property localStorage ... which has only a
|
||||||
|
// getter") under vitest 5, which no longer shadows it with a writable global.
|
||||||
|
// defineProperty replaces the accessor outright and works on both.
|
||||||
|
Object.defineProperty(globalThis, 'localStorage', {
|
||||||
|
value: new LocalStorageMock() as unknown as Storage,
|
||||||
|
writable: true,
|
||||||
|
configurable: true,
|
||||||
|
})
|
||||||
|
|
||||||
// Make Vue composables globally available
|
// Make Vue composables globally available
|
||||||
global.ref = Vue.ref
|
global.ref = Vue.ref
|
||||||
|
|||||||
Reference in new issue
Block a user