diff --git a/tests/unit/mock-router.js b/tests/unit/mock-router.js new file mode 100644 index 0000000000000000000000000000000000000000..f4f46df86ea3c1d76d254c9bc54fb5aa845c6cb2 --- /dev/null +++ b/tests/unit/mock-router.js @@ -0,0 +1,21 @@ +// route id param for pages that require routing +// id = 1, user = test testesen +export const route = { + params: { + id: 1 + } +}; + +export const router = { +push: jest.fn() +}; + +export const $route = { + params: { + id: 1 + } +}; + +export const $router = { +push: jest.fn() +}; \ No newline at end of file diff --git a/tests/unit/mock-store.js b/tests/unit/mock-store.js new file mode 100644 index 0000000000000000000000000000000000000000..c31cc0f64615756e95c56a9c7eaaf4644526a656 --- /dev/null +++ b/tests/unit/mock-store.js @@ -0,0 +1,34 @@ +const user = { + state: { + token: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmaXJzdE5hbWUiOiJUZXN0IiwibGFzdE5hbWUiOiJUZXN0ZXNlbiIsImFjY291bnRJZCI6IjEiLCJleHAiOjE2NTE2NTQxNDUsImVtYWlsIjoidGVzdEB0ZXN0LmNvbSJ9.LnOYs_9WLusp463bQo9aXPcNGI4ooz7uI3iiMrnSPTY", + }, + + mutations: { + logout(state) { + state.token = null; + }, + saveToken(state, token) { + state.token = token; + }, + }, +} + +export const store = { + state: { + user, + }, + modules: { + user, + }, + commit: jest.fn() +} + +export const $store = { + state: { + user, + }, + modules: { + user, + }, + commit: jest.fn() +} \ No newline at end of file