Skip to content

Commit

Permalink
add basic tests for ImageView.vue
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
  • Loading branch information
Julien Veyssier committed Jan 3, 2022
1 parent 342952d commit 1f9cef4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/tests/nodes/ImageView.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,18 @@ describe('Image View src attribute based on markdown', () => {
expect(wrapper.find('.image__main').attributes('src'))
.toBe('https://nextcloud/index.php/apps/files_sharing/publicpreview/CSYoWifBzrsMWeA?file=/deck11-calendar.png&x=1760&y=990&a=true')
})

test('image served by the Text app API', () => {
const wrapper = factory({src: 'text://image?imageFileName=1640709467-a%60a%60a.png'})
expect(wrapper.vm.isSupportedImage).toBe(true)
expect(wrapper.find('.image__main').attributes('src'))
.toContain('apps/text/image?documentId=')
})

test('image served by the Text app API', () => {
const wrapper = factory({src: 'text://image?imageFileName=1640709467-a%60a%60a.png'})
expect(wrapper.vm.isSupportedImage).toBe(true)
expect(wrapper.find('.image__main').attributes('src'))
.toContain('imageFileName=1640709467-a%60a%60a.png')
})
})

0 comments on commit 1f9cef4

Please sign in to comment.