File tree Expand file tree Collapse file tree 2 files changed +13
-21
lines changed
src/components/DsfrHighlight Expand file tree Collapse file tree 2 files changed +13
-21
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import { within , expect } from '@storybook/test'
12import DsfrHighlight from './DsfrHighlight.vue'
23
34/**
@@ -44,6 +45,11 @@ MiseEnExergue.args = {
4445 large : false ,
4546 text : 'Texte original de la mise en exergue' ,
4647}
48+ MiseEnExergue . play = async ( { canvasElement } ) => {
49+ const canvas = within ( canvasElement )
50+ const highlight = canvas . getByText ( MiseEnExergue . args . text )
51+ expect ( highlight ) . toBeVisible ( )
52+ }
4753
4854export const MiseEnExergueAvecSlot = ( args ) => ( {
4955 components : {
@@ -60,12 +66,18 @@ export const MiseEnExergueAvecSlot = (args) => ({
6066 :small="small"
6167 :large="large"
6268 >
63- <p v-if="!text">Le fameux slot mis en exergue</p >
69+ <template v-if="!text">{{ slotText }}</template >
6470 </DsfrHighlight>
6571 ` ,
6672} )
6773MiseEnExergueAvecSlot . args = {
6874 small : false ,
6975 large : false ,
7076 text : '' ,
77+ slotText : 'Le fameux slot mis en exergue' ,
78+ }
79+ MiseEnExergueAvecSlot . play = async ( { canvasElement } ) => {
80+ const canvas = within ( canvasElement )
81+ const highlight = canvas . getByText ( MiseEnExergueAvecSlot . args . slotText )
82+ expect ( highlight ) . toBeVisible ( )
7183}
You can’t perform that action at this time.
0 commit comments