diff --git a/tests/config/update-config.test.ts b/tests/config/update-config.test.ts index 198e63f..4a903c3 100644 --- a/tests/config/update-config.test.ts +++ b/tests/config/update-config.test.ts @@ -6,11 +6,15 @@ import { DEFAULT_NOTIFICATION_OPTIONS as defaultNot, } from '@/core/constants' -import type { UseNotivueReturn, NotivueConfig, NotivueConfigRequired } from 'notivue' +import { ref } from 'vue' + +import type { NotivueConfig, NotivueConfigRequired, ConfigSlice } from 'notivue' type ConfigPairs = [K, NotivueConfig[K]] describe('Update method', () => { + const isRunning = ref(true) + test('Should update primitive properties', () => { const newConf: ConfigPairs[] = [ ['pauseOnTouch', false], @@ -22,7 +26,7 @@ describe('Update method', () => { ['limit', Math.random() * 100], ] - const config = createConfig({}) as UseNotivueReturn + const config = createConfig({}, isRunning) as ConfigSlice for (const [key, value] of newConf) { expect(config[key].value).not.toBe(value) @@ -37,7 +41,7 @@ describe('Update method', () => { test('Animations', () => { const animations = { enter: 'Vitest_Enter', leave: 'Vitest_Leave' } - const config = createConfig({}) + const config = createConfig({}, isRunning) as ConfigSlice config.update({ animations }) @@ -59,7 +63,7 @@ describe('Update method', () => { 'promise-reject': { duration: Math.random() * 100 }, } - const config = createConfig({}) as UseNotivueReturn + const config = createConfig({}, isRunning) as ConfigSlice config.update({ notifications: newConf }) @@ -89,7 +93,7 @@ describe('Update method', () => { }, } - const c = createConfig(userConf) as UseNotivueReturn + const c = createConfig(userConf, isRunning) as ConfigSlice let prevConf = {} as NotivueConfigRequired diff --git a/tests/package.json b/tests/package.json index ed9bcbb..7445a3b 100644 --- a/tests/package.json +++ b/tests/package.json @@ -10,17 +10,17 @@ "notivue": "workspace:*" }, "devDependencies": { - "@types/node": "^20.12.5", + "@types/node": "^20.12.7", "@vitejs/plugin-vue": "^5.0.4", "@vue/test-utils": "^2.4.5", "axe-core": "^4.9.0", - "cypress": "^13.7.2", + "cypress": "^13.7.3", "cypress-axe": "^1.5.0", "cypress-real-events": "^1.12.0", - "typescript": "^5.4.4", + "typescript": "^5.4.5", "vite": "^5.2.8", - "vitest": "^1.4.0", + "vitest": "^1.5.0", "vue": "^3.4.21", - "vue-tsc": "^2.0.10" + "vue-tsc": "^2.0.13" } }