mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Sketch ChangePassword component + spec
This commit is contained in:
parent
3a768a66d5
commit
a900435d58
72
components/ChangePassword.spec.js
Normal file
72
components/ChangePassword.spec.js
Normal file
@ -0,0 +1,72 @@
|
||||
import { shallowMount, createLocalVue } from '@vue/test-utils'
|
||||
import ChangePassword from './ChangePassword.vue'
|
||||
import Vue from 'vue'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Styleguide)
|
||||
|
||||
describe('ChangePassword.vue', () => {
|
||||
let store
|
||||
let mocks
|
||||
let wrapper
|
||||
|
||||
beforeEach(() => {
|
||||
mocks = {
|
||||
$apollo: {
|
||||
mutate: jest.fn().mockResolvedValue()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
describe('shallowMount', () => {
|
||||
const Wrapper = () => {
|
||||
return shallowMount(ChangePassword, { mocks, localVue })
|
||||
}
|
||||
|
||||
it.todo('renders')
|
||||
|
||||
describe('validations', () => {
|
||||
it.todo('is disabled')
|
||||
|
||||
describe('old password and new password', () => {
|
||||
describe('match', () => {
|
||||
it.todo('invalid')
|
||||
it.todo('displays a warning')
|
||||
})
|
||||
})
|
||||
|
||||
describe('new password and confirmation', () => {
|
||||
describe('mismatch', () => {
|
||||
it.todo('invalid')
|
||||
it.todo('displays a warning')
|
||||
})
|
||||
|
||||
describe('match', () => {
|
||||
describe('and old password mismatch', () => {
|
||||
it.todo('valid')
|
||||
})
|
||||
|
||||
describe('clicked', () => {
|
||||
it.todo('sets loading')
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('given valid input', () => {
|
||||
describe('click on submit button', () => {
|
||||
it.todo('calls changePassword mutation')
|
||||
|
||||
describe('mutation resolves', () => {
|
||||
it.todo('calls auth/SET_TOKEN with response')
|
||||
})
|
||||
|
||||
describe('mutation rejects', () => {
|
||||
it.todo('displays error message')
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
2
components/ChangePassword.vue
Normal file
2
components/ChangePassword.vue
Normal file
@ -0,0 +1,2 @@
|
||||
<template>
|
||||
</template>
|
||||
Loading…
x
Reference in New Issue
Block a user