Skip to content

Commit 36098e9

Browse files
author
Arman
committed
geophystech#137 tests. Authentication.
1 parent 3cf14f7 commit 36098e9

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

test/unit/specs/users/Authentication.spec.js

+21-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import { shallowMount, createLocalVue } from '@vue/test-utils'
22
import Authentication from '@/components/users/Authentication'
33
import BootstrapVue from 'bootstrap-vue'
4-
import {$routerMocks, RouterLink, describeCheckFormFields} from '../../utils'
4+
import Toasted from 'vue-toasted'
55
import $moment from 'moment'
6+
import {$routerMocks, RouterLink, describeCheckFormFields} from '../../utils'
67
// import $http from 'axios'
78

89
const localVue = createLocalVue()
910
localVue.use(BootstrapVue)
11+
localVue.use(Toasted)
1012

1113
const request = (_url, _data) => {
1214
return new Promise((resolve, reject) => {
@@ -21,6 +23,23 @@ const mockHttp = {
2123

2224
describe('users/Authentication.vue', () => {
2325

26+
const mocks = {
27+
28+
$http: mockHttp,
29+
$moment,
30+
31+
$refs: {
32+
form: {
33+
checkValidity: () => false
34+
}
35+
},
36+
37+
$toasted: {
38+
success: (msg, params) => {}
39+
}
40+
41+
}
42+
2443
const propsData = {
2544
form: {
2645

@@ -38,7 +57,7 @@ describe('users/Authentication.vue', () => {
3857
})
3958

4059
const wrapper = shallowMount(Authentication, {
41-
mocks: Object.assign({ $http: mockHttp, $moment }, $routerMocks),
60+
mocks: Object.assign(mocks, $routerMocks),
4261
stubs: { RouterLink },
4362
propsData,
4463
localVue
@@ -50,10 +69,4 @@ describe('users/Authentication.vue', () => {
5069

5170
describeCheckFormFields(wrapper, { fields })
5271

53-
/*it('Auth', async () => {
54-
55-
wrapper.find('b-button-stub[type="submit"]').trigger('click')
56-
57-
})*/
58-
5972
})

0 commit comments

Comments
 (0)