summaryrefslogtreecommitdiffstats
path: root/tests/javascript/unit/components/routes/Explore.spec.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/javascript/unit/components/routes/Explore.spec.ts')
-rw-r--r--tests/javascript/unit/components/routes/Explore.spec.ts32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/javascript/unit/components/routes/Explore.spec.ts b/tests/javascript/unit/components/routes/Explore.spec.ts
new file mode 100644
index 000000000..04c7d6508
--- /dev/null
+++ b/tests/javascript/unit/components/routes/Explore.spec.ts
@@ -0,0 +1,32 @@
+import axios from '@nextcloud/axios'
+import { shallowMount, createLocalVue } from '@vue/test-utils'
+
+import * as router from '@nextcloud/router'
+
+import Explore from '../../../../../src/components/routes/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()
+ })
+})