diff options
author | Devlin Junker <devlin.junker@gmail.com> | 2022-10-06 21:50:25 -0700 |
---|---|---|
committer | Benjamin Brahmer <info@b-brahmer.de> | 2022-11-02 11:27:20 +0100 |
commit | 6557bb28732e03f3831b9c4ebce64346ce9695f5 (patch) | |
tree | 2a3c3a5f6f97fe50c91ea6a6a7112068d856a71a /tests | |
parent | 902ff04ac2fabb47eed1087927ab2acc75693cd0 (diff) |
test file for each component
Signed-off-by: Devlin Junker <devlin.junker@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/javascript/unit/components/AddFeed.spec.ts | 15 | ||||
-rw-r--r-- | tests/javascript/unit/components/Explore.spec.ts | 21 | ||||
-rw-r--r-- | tests/javascript/unit/components/Sidebar.spec.ts | 8 |
3 files changed, 40 insertions, 4 deletions
diff --git a/tests/javascript/unit/components/AddFeed.spec.ts b/tests/javascript/unit/components/AddFeed.spec.ts new file mode 100644 index 000000000..224a4287c --- /dev/null +++ b/tests/javascript/unit/components/AddFeed.spec.ts @@ -0,0 +1,15 @@ +import AddFeed from 'Components/AddFeed.vue' + +import { store, localVue } from '../setupStore' + +import { shallowMount } from '@vue/test-utils' + +describe('AddFeed.vue', () => { + 'use strict' + + it('should initialize without showing createNewFolder', () => { + const wrapper = shallowMount(AddFeed, { localVue, store }) + + expect(wrapper.vm.$data.createNewFolder).toBeFalsy + }); +});
\ No newline at end of file diff --git a/tests/javascript/unit/components/Explore.spec.ts b/tests/javascript/unit/components/Explore.spec.ts new file mode 100644 index 000000000..0ac31835b --- /dev/null +++ b/tests/javascript/unit/components/Explore.spec.ts @@ -0,0 +1,21 @@ +import Explore from 'Components/Explore.vue' +import sinon from 'sinon'; +import axios from '@nextcloud/axios' +import * as router from '@nextcloud/router' + +import { store, localVue } from '../setupStore' + +import { shallowMount } from '@vue/test-utils' + +describe('Explore.vue', () => { + 'use strict' + + it('should initialize without showing AddFeed Component', () => { + sinon.stub(axios, 'get').resolves({ data: { } }); + sinon.stub(router, 'generateUrl').returns(''); + + const wrapper = shallowMount(Explore, { localVue, store }) + + expect(wrapper.vm.$data.showAddFeed).toBeFalsy + }); +});
\ No newline at end of file diff --git a/tests/javascript/unit/components/Sidebar.spec.ts b/tests/javascript/unit/components/Sidebar.spec.ts index b8c0ab1fc..d71e8bcb2 100644 --- a/tests/javascript/unit/components/Sidebar.spec.ts +++ b/tests/javascript/unit/components/Sidebar.spec.ts @@ -13,11 +13,11 @@ describe('Sidebar.vue', () => { expect(wrapper.vm.$data.showAddFeed).toBeFalsy }); - it('should dispatch message to store with folder name to create new folder'); + it('should dispatch message to store with folder name to create new folder', () => {}); - it('should dispatch message to store with folder object on delete folder') + it('should dispatch message to store with folder object on delete folder', () => {}) - it('should set showAddFeed to true') + it('should set showAddFeed to true', () => {}) - it('should set showAddFeed to false') + it('should set showAddFeed to false', () => {}) }) |