Skip to content
Snippets Groups Projects
Commit f555dc48 authored by Gilgard's avatar Gilgard
Browse files

funktional mocking of route and store

parent 73e06ed7
No related branches found
No related tags found
1 merge request!80View tests
Pipeline #179333 failed
// 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
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment