feat(test): EpisodeProgress tests

This commit is contained in:
Phan An 2024-06-02 15:52:31 +08:00
parent 1881c60407
commit 7d3215a323
2 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,21 @@
import { expect, it } from 'vitest'
import UnitTestCase from '@/__tests__/UnitTestCase'
import Component from './EpisodeProgress.vue'
import factory from '@/__tests__/factory'
new class extends UnitTestCase {
protected test () {
it('renders', () => {
const { html } = this.render(Component, {
props: {
episode: factory('episode', {
length: 300
}),
position: 60
}
})
expect(html()).toMatchSnapshot()
})
}
}

View file

@ -0,0 +1,3 @@
// Vitest Snapshot v1
exports[`renders 1`] = `<div class="relative h-1 w-full rounded-full overflow-hidden bg-white/30"><span class="absolute h-full bg-k-accent top-0 left-0" style="width: 20%;"></span></div>`;