File tree 12 files changed +207
-26
lines changed
12 files changed +207
-26
lines changed Original file line number Diff line number Diff line change 5
5
<script >
6
6
import {createMap , createMapEventMarker } from ' @/map_functions'
7
7
import {EVENTS_RANGES } from ' @/helpers/event'
8
+ import apiSettings from ' @/settings/api'
8
9
9
10
export default {
10
11
data () {
30
31
})
31
32
32
33
const defaultEventsRange = this .map .defaultEventsRange
33
- let apiSettings = this .$root .$options .settings .api
34
34
let $moment = this .$moment
35
35
let $http = this .$http
36
36
Original file line number Diff line number Diff line change
1
+ import 'leaflet/dist/leaflet'
2
+ import 'leaflet/dist/leaflet.css'
3
+
4
+ import 'leaflet-spin/example/spin/dist/spin'
5
+ import 'leaflet-spin/leaflet.spin'
6
+
7
+ import 'leaflet-fullscreen/dist/Leaflet.fullscreen'
8
+ import 'leaflet-fullscreen/dist/leaflet.fullscreen.css'
9
+
10
+ import 'leaflet-dvf/dist/leaflet-dvf'
11
+ import 'leaflet-dvf/dist/css/dvf.css'
12
+
13
+ import 'leaflet-zoomhome/dist/leaflet.zoomhome'
14
+
15
+ import 'leaflet.markercluster/dist/leaflet.markercluster'
16
+ import 'leaflet.markercluster/dist/MarkerCluster.css'
17
+ import 'leaflet.markercluster/dist/MarkerCluster.Default.css'
18
+
19
+ import 'leaflet.gridlayer.googlemutant/Leaflet.GoogleMutant'
20
+ import 'leaflet-yandex-tile/dist/leaflet.yandex-tile'
21
+
22
+ import 'leaflet-gesture-handling/dist/leaflet-gesture-handling.min'
23
+ import 'leaflet-gesture-handling/dist/leaflet-gesture-handling.min.css'
Original file line number Diff line number Diff line change @@ -24,31 +24,7 @@ import 'bootstrap-vue/dist/bootstrap-vue.css'
24
24
import 'vue-toasted/dist/vue-toasted.min.css'
25
25
import 'moment/locale/ru'
26
26
27
- // Leaflet
28
-
29
- import 'leaflet/dist/leaflet'
30
- import 'leaflet/dist/leaflet.css'
31
-
32
- import 'leaflet-spin/example/spin/dist/spin'
33
- import 'leaflet-spin/leaflet.spin'
34
-
35
- import 'leaflet-fullscreen/dist/Leaflet.fullscreen'
36
- import 'leaflet-fullscreen/dist/leaflet.fullscreen.css'
37
-
38
- import 'leaflet-dvf/dist/leaflet-dvf'
39
- import 'leaflet-dvf/dist/css/dvf.css'
40
-
41
- import 'leaflet-zoomhome/dist/leaflet.zoomhome'
42
-
43
- import 'leaflet.markercluster/dist/leaflet.markercluster'
44
- import 'leaflet.markercluster/dist/MarkerCluster.css'
45
- import 'leaflet.markercluster/dist/MarkerCluster.Default.css'
46
-
47
- import 'leaflet.gridlayer.googlemutant/Leaflet.GoogleMutant'
48
- import 'leaflet-yandex-tile/dist/leaflet.yandex-tile'
49
-
50
- import 'leaflet-gesture-handling/dist/leaflet-gesture-handling.min'
51
- import 'leaflet-gesture-handling/dist/leaflet-gesture-handling.min.css'
27
+ import './leaflet'
52
28
53
29
import 'font-awesome/css/font-awesome.min.css'
54
30
import { authTimeoutChech } from '@/helpers/auth'
Original file line number Diff line number Diff line change
1
+ import { shallowMount } from '@vue/test-utils'
2
+ import Spinner from '@/components/Spinner'
3
+
4
+ describe ( 'Spinner.vue' , ( ) => {
5
+ const wrapper = shallowMount ( Spinner , {
6
+ mocks : {
7
+ }
8
+ } )
9
+ it ( 'Check simple spinner' , ( ) => {
10
+ expect ( wrapper . contains ( '.vue-simple-spinner' ) ) . to . eql ( true )
11
+ } )
12
+ } )
Original file line number Diff line number Diff line change
1
+ import { shallowMount } from '@vue/test-utils'
2
+ import StaticPage from '@/components/StaticPage'
3
+ import * as $moment from 'moment'
4
+ import $http from 'axios'
5
+
6
+ describe ( 'StaticPage.vue' , ( ) => {
7
+
8
+ const $router = {
9
+ currentRoute : {
10
+ params : {
11
+ page : 'about'
12
+ }
13
+ }
14
+ }
15
+
16
+ const wrapper = shallowMount ( StaticPage , {
17
+ mocks : {
18
+ $http, $moment, $router
19
+ }
20
+ } )
21
+
22
+ it ( 'Check component StaticPage' , ( ) => {
23
+ expect ( wrapper . is ( StaticPage ) ) . to . eql ( true )
24
+ } )
25
+
26
+ } )
Original file line number Diff line number Diff line change
1
+ import { shallowMount } from '@vue/test-utils'
2
+ import BuildingsMap from '@/components/maps/Buildings'
3
+ import $http from 'axios'
4
+ import '@/leaflet'
5
+ import { mapPropDataGen } from '../../utils'
6
+
7
+ describe ( 'maps/Buildings.vue' , ( ) => {
8
+
9
+ const wrapper = shallowMount ( BuildingsMap , {
10
+ propsData : mapPropDataGen ( 'BuildingsMap' ) ,
11
+ attachToDocument : true ,
12
+ mocks : {
13
+ $http
14
+ }
15
+ } )
16
+
17
+ it ( 'Buildings map rendered' , ( ) => {
18
+ expect ( wrapper . is ( BuildingsMap ) ) . to . eql ( true )
19
+ } )
20
+ } )
Original file line number Diff line number Diff line change
1
+ import { shallowMount } from '@vue/test-utils'
2
+ import GeneralInformationMap from '@/components/maps/GeneralInformation'
3
+ import $http from 'axios'
4
+ import '@/leaflet'
5
+ import { mapPropDataGen } from '../../utils'
6
+
7
+ describe ( 'maps/GeneralInformation.vue' , ( ) => {
8
+
9
+ const wrapper = shallowMount ( GeneralInformationMap , {
10
+ propsData : mapPropDataGen ( 'GeneralInformationMap' ) ,
11
+ attachToDocument : true ,
12
+ mocks : {
13
+ $http
14
+ }
15
+ } )
16
+
17
+ it ( 'GeneralInformation map rendered' , ( ) => {
18
+ expect ( wrapper . is ( GeneralInformationMap ) ) . to . eql ( true )
19
+ } )
20
+
21
+ } )
Original file line number Diff line number Diff line change
1
+ import { shallowMount } from '@vue/test-utils'
2
+ import LDOsMap from '@/components/maps/LDOs'
3
+ import $http from 'axios'
4
+ import '@/leaflet'
5
+ import { mapPropDataGen } from '../../utils'
6
+
7
+ describe ( 'maps/LDOs.vue' , ( ) => {
8
+
9
+ const wrapper = shallowMount ( LDOsMap , {
10
+ propsData : mapPropDataGen ( 'LDOsMap' ) ,
11
+ attachToDocument : true ,
12
+ mocks : {
13
+ $http
14
+ }
15
+ } )
16
+
17
+ it ( 'LDOs map rendered' , ( ) => {
18
+ expect ( wrapper . is ( LDOsMap ) ) . to . eql ( true )
19
+ } )
20
+
21
+ } )
Original file line number Diff line number Diff line change
1
+ import { shallowMount } from '@vue/test-utils'
2
+ import MainpageMap from '@/components/maps/Mainpage'
3
+ import { mapPropDataGen } from '../../utils'
4
+ import * as $moment from 'moment'
5
+ import $http from 'axios'
6
+ import '@/leaflet'
7
+
8
+ describe ( 'maps/Mainpage.vue' , ( ) => {
9
+
10
+ const propsData = mapPropDataGen ( 'MainpageMap' )
11
+
12
+ const $store = {
13
+ getters : {
14
+ user : {
15
+ authenticated : false
16
+ }
17
+ }
18
+ }
19
+
20
+ const wrapper = shallowMount ( MainpageMap , {
21
+ attachToDocument : true ,
22
+ propsData,
23
+ mocks : {
24
+ $http, $store, $moment
25
+ }
26
+ } )
27
+
28
+ it ( 'Mainpage map rendered' , ( ) => {
29
+ expect ( wrapper . is ( MainpageMap ) ) . to . eql ( true )
30
+ } )
31
+
32
+ } )
Original file line number Diff line number Diff line change
1
+ import { shallowMount } from '@vue/test-utils'
2
+ import ModalMap from '@/components/maps/ModalMap'
3
+
4
+ describe ( 'maps/ModalMap.vue' , ( ) => {
5
+ const wrapper = shallowMount ( ModalMap , {
6
+ mocks : {
7
+ }
8
+ } )
9
+ it ( 'Modal map rendered' , ( ) => {
10
+ expect ( wrapper . contains ( '#map-dialog' ) ) . to . eql ( true )
11
+ } )
12
+ } )
Original file line number Diff line number Diff line change
1
+ import { shallowMount } from '@vue/test-utils'
2
+ import SettlementsMap from '@/components/maps/Settlements'
3
+ import $http from 'axios'
4
+ import '@/leaflet'
5
+ import { mapPropDataGen } from '../../utils'
6
+
7
+ describe ( 'maps/Settlements.vue' , ( ) => {
8
+
9
+ const wrapper = shallowMount ( SettlementsMap , {
10
+ propsData : mapPropDataGen ( 'SettlementsMap' ) ,
11
+ attachToDocument : true ,
12
+ mocks : {
13
+ $http
14
+ }
15
+ } )
16
+
17
+ it ( 'Settlements map rendered' , ( ) => {
18
+ expect ( wrapper . is ( SettlementsMap ) ) . to . eql ( true )
19
+ } )
20
+ } )
Original file line number Diff line number Diff line change
1
+ import * as $moment from 'moment'
2
+ import $http from 'axios'
3
+
4
+ export function mapPropDataGen ( mapId )
5
+ {
6
+ return {
7
+ event : {
8
+ id : `test-${ mapId } -event` ,
9
+ locValues : {
10
+ data : {
11
+ lat : '58.651' ,
12
+ lon : '142.395'
13
+ }
14
+ }
15
+ } ,
16
+ tab : `test-${ mapId } -tab`
17
+ }
18
+ }
You can’t perform that action at this time.
0 commit comments