Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JanAckermann committed May 2, 2022
1 parent 3b8bf40 commit 02dac6c
Showing 1 changed file with 0 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ localVue.use(DesignSystem)
localVue.use(VueCompositionAPI)
localVue.use(Vuex)

const selectors = {
searchPreview: '.oc-resource'
}

const searchResult = {
id: 1234,
data: {
Expand All @@ -24,10 +20,6 @@ const searchResult = {
}
}

const spyTriggerDefaultAction = jest
.spyOn(Preview.mixins[0].methods, '$_fileActions_triggerDefaultAction')
.mockImplementation()

describe('Preview component', () => {
it('should set correct props on oc-resource component', () => {
const wrapper = getWrapper()
Expand All @@ -36,16 +28,6 @@ describe('Preview component', () => {
expect(ocResource.exists()).toBeTruthy()
expect(ocResource.props().resource).toMatchObject(searchResult.data)
})
it('should trigger the default action when search preview button is clicked', async () => {
const wrapper = getWrapper()
const searchPreview = wrapper.find(selectors.searchPreview)

expect(spyTriggerDefaultAction).toHaveBeenCalledTimes(0)

await searchPreview.trigger('click')

expect(spyTriggerDefaultAction).toHaveBeenCalledTimes(1)
})
describe('folder and parent folder link', () => {
it('should be empty if no resource target location given', () => {
const wrapper = getWrapper({ resourceTargetLocation: null })
Expand Down

0 comments on commit 02dac6c

Please sign in to comment.