Skip to content

Commit

Permalink
adapt tests to use new content template component
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Tirk <[email protected]>
  • Loading branch information
powerpaul17 committed Oct 29, 2023
1 parent e609f8d commit bfbee86
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
5 changes: 3 additions & 2 deletions tests/javascript/unit/components/routes/All.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Vuex, { Store } from 'vuex'
import { shallowMount, createLocalVue, Wrapper } from '@vue/test-utils'

import All from '../../../../../src/components/routes/All.vue'
import FeedItemDisplayList from '../../../../../src/components/feed-display/FeedItemDisplayList.vue'
import ContentTemplate from '../../../../../src/components/ContentTemplate.vue'

jest.mock('@nextcloud/axios')

Expand Down Expand Up @@ -48,7 +48,8 @@ describe('All.vue', () => {
})

it('should get all items from state', () => {
expect((wrapper.findComponent(FeedItemDisplayList)).props().items.length).toEqual(3)
console.warn('PROPS', wrapper.findComponent(ContentTemplate).props());
expect((wrapper.findComponent(ContentTemplate)).props().items.length).toEqual(3)
})

it('should dispatch FETCH_ITEMS action if not fetchingItems.all', () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/javascript/unit/components/routes/Feed.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Vuex, { Store } from 'vuex'
import { shallowMount, createLocalVue, Wrapper } from '@vue/test-utils'

import Feed from '../../../../../src/components/routes/Feed.vue'
import FeedItemDisplayList from '../../../../../src/components/feed-display/FeedItemDisplayList.vue'
import ContentTemplate from '../../../../../src/components/ContentTemplate.vue'

jest.mock('@nextcloud/axios')

Expand Down Expand Up @@ -65,7 +65,7 @@ describe('Feed.vue', () => {
})

it('should get starred items from state', () => {
expect((wrapper.findComponent(FeedItemDisplayList)).props().items.length).toEqual(2)
expect((wrapper.findComponent(ContentTemplate)).props().items.length).toEqual(2)
})

it('should dispatch FETCH_FEED_ITEMS action if not fetchingItems.starred', () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/javascript/unit/components/routes/Folder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Vuex, { Store } from 'vuex'
import { shallowMount, createLocalVue, Wrapper } from '@vue/test-utils'

import Folder from '../../../../../src/components/routes/Folder.vue'
import FeedItemDisplayList from '../../../../../src/components/feed-display/FeedItemDisplayList.vue'
import ContentTemplate from '../../../../../src/components/ContentTemplate.vue'

jest.mock('@nextcloud/axios')

Expand Down Expand Up @@ -79,7 +79,7 @@ describe('Folder.vue', () => {
})

it('should get folder items from state', () => {
expect((wrapper.findComponent(FeedItemDisplayList)).props().items.length).toEqual(2)
expect((wrapper.findComponent(ContentTemplate)).props().items.length).toEqual(2)
})

it('should dispatch FETCH_FOLDER_FEED_ITEMS action on fetchMore', () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/javascript/unit/components/routes/Starred.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Vuex, { Store } from 'vuex'
import { shallowMount, createLocalVue, Wrapper } from '@vue/test-utils'

import Starred from '../../../../../src/components/routes/Starred.vue'
import FeedItemDisplayList from '../../../../../src/components/feed-display/FeedItemDisplayList.vue'
import ContentTemplate from '../../../../../src/components/ContentTemplate.vue'

jest.mock('@nextcloud/axios')

Expand Down Expand Up @@ -48,7 +48,7 @@ describe('Starred.vue', () => {
})

it('should get starred items from state', () => {
expect((wrapper.findComponent(FeedItemDisplayList)).props().items.length).toEqual(1)
expect((wrapper.findComponent(ContentTemplate)).props().items.length).toEqual(1)
})

it('should dispatch FETCH_STARRED action if not fetchingItems.starred', () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/javascript/unit/components/routes/Unread.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Vuex, { Store } from 'vuex'
import { shallowMount, createLocalVue, Wrapper } from '@vue/test-utils'

import Unread from '../../../../../src/components/routes/Unread.vue'
import FeedItemDisplayList from '../../../../../src/components/feed-display/FeedItemDisplayList.vue'
import ContentTemplate from '../../../../../src/components/ContentTemplate.vue'

jest.mock('@nextcloud/axios')

Expand Down Expand Up @@ -48,7 +48,7 @@ describe('Unread.vue', () => {
})

it('should get unread items from state', () => {
expect((wrapper.findComponent(FeedItemDisplayList)).props().items.length).toEqual(2)
expect((wrapper.findComponent(ContentTemplate)).props().items.length).toEqual(2)
})

it('should dispatch FETCH_UNREAD action if not fetchingItems.unread', () => {
Expand Down

0 comments on commit bfbee86

Please sign in to comment.