fix(test): fix ScreenHeader tests

This commit is contained in:
Phan An 2022-07-21 11:54:38 +02:00
parent 12a8179e4c
commit 1d73a8c984
No known key found for this signature in database
GPG key ID: A81E4477F0BB6FDC
3 changed files with 10 additions and 7 deletions

View file

@ -1,9 +1,9 @@
import { expect, it } from 'vitest'
import { preferenceStore } from '@/stores'
import UnitTestCase from '@/__tests__/UnitTestCase'
import RepeatModeSwitch from './RepeatModeSwitch.vue'
import { fireEvent } from '@testing-library/vue'
import { playbackService } from '@/services'
import RepeatModeSwitch from './RepeatModeSwitch.vue'
new class extends UnitTestCase {
protected test () {

View file

@ -9,7 +9,8 @@ new class extends UnitTestCase {
slots: {
default: 'This Header',
meta: '<p>Some meta</p>',
controls: '<nav>Some controls</nav>'
controls: '<nav>Some controls</nav>',
thumbnail: '<img src="https://placekitten.com/200/300" />'
}
}).html()).toMatchSnapshot()
})

View file

@ -1,11 +1,13 @@
// Vitest Snapshot v1
exports[`renders 1`] = `
<header class="screen-header" data-v-661f8f0d="">
<div class="thumbnail-wrapper" data-v-661f8f0d=""></div>
<div class="heading-wrapper" data-v-661f8f0d="">
<h1 data-v-661f8f0d="">This Header</h1><span class="meta text-secondary" data-v-661f8f0d=""><p>Some meta</p></span>
<header class="screen-header expanded">
<div class="thumbnail-wrapper"><img src="https://placekitten.com/200/300"></div>
<div class="right">
<div class="heading-wrapper">
<h1 class="name">This Header</h1><span class="meta text-secondary"><p>Some meta</p></span>
</div>
<nav>Some controls</nav>
</div>
<nav>Some controls</nav>
</header>
`;