summaryrefslogtreecommitdiffstats
path: root/tests/javascript/unit/components/Explore.spec.ts
blob: b2ab052d55707f022dae7fa16a2fbccb17f2107f (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
import axios from '@nextcloud/axios'
import { shallowMount, createLocalVue } from '@vue/test-utils'

import * as router from '@nextcloud/router'

import Explore from '../../../../src/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: [],
					},
				},
			},
		})

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