summaryrefslogtreecommitdiffstats
path: root/tests/javascript/unit/components/Explore.spec.ts
blob: 3e24f2890ae4b60f51a3dbda33af3ca907300bd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import axios from '@nextcloud/axios'
import { shallowMount, createLocalVue } from '@vue/test-utils'

import * as router from '@nextcloud/router';

import Explore from 'Components/Explore.vue';

jest.mock('@nextcloud/axios');

describe('Explore.vue', () => {
	'use strict'

	const localVue = createLocalVue()
	
	
	it('should initialize without showing AddFeed Component', () => {
		(axios as any).get.mockResolvedValue({ data: { } })
    (router as any).generateUrl = jest.fn().mockReturnValue('');
    
		const wrapper = shallowMount(Explore, { 
			localVue,
			mocks: { 
				$store: { 
					state: { 
						feeds: [], 
						folders: [] 
					}
				}
			}
		})

		const wrapper = shallowMount(Explore, { localVue, store });

		expect(wrapper.vm.$data.showAddFeed).toBeFalsy;
	});
});