1
1
import { shallowMount , createLocalVue } from '@vue/test-utils'
2
2
import Filters from '@/components/Filters'
3
3
import BootstrapVue from 'bootstrap-vue'
4
- import { $routerMocks , eventFilters } from '../utils'
4
+ import { $routerMocks , describeCheckFormFields } from '../utils'
5
5
import $moment from 'moment'
6
6
import $http from 'axios'
7
7
@@ -28,18 +28,23 @@ describe('Filters.vue', () => {
28
28
expect ( wrapper . is ( Filters ) ) . to . eql ( true )
29
29
} )
30
30
31
- describe ( 'Check filter fields' , ( ) => {
32
-
33
- for ( let item of Object . entries ( eventFilters ) )
34
- {
35
- const [ filterName , filterConf ] = item
36
- const field = wrapper . find ( `${ filterConf . tag } [name="${ filterName } "]` )
37
-
38
- it ( `Check filter ${ filterName } ` , ( ) => {
39
- expect ( field . exists ( ) ) . to . eql ( true )
40
- } )
31
+ describeCheckFormFields ( wrapper , {
32
+ label : 'Check filter fields' ,
33
+ fields : {
34
+ datetime_max : { tag : 'flat-pickr-stub' } ,
35
+ datetime_min : { tag : 'flat-pickr-stub' } ,
36
+ depth_max : { tag : 'b-form-input-stub' } ,
37
+ depth_min : { tag : 'b-form-input-stub' } ,
38
+ has_mt : { tag : 'b-form-checkbox-stub' } ,
39
+ mag_max : { tag : 'b-form-input-stub' } ,
40
+ mag_min : { tag : 'b-form-input-stub' } ,
41
+ lat_max : { tag : 'b-form-input-stub' } ,
42
+ lat_min : { tag : 'b-form-input-stub' } ,
43
+ lon_max : { tag : 'b-form-input-stub' } ,
44
+ lon_min : { tag : 'b-form-input-stub' } ,
45
+ rms_max : { tag : 'b-form-input-stub' } ,
46
+ sta_num_min : { tag : 'b-form-input-stub' }
41
47
}
42
-
43
48
} )
44
49
45
50
} )
0 commit comments