Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
camino
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
pnm-public
camino
Commits
86fc8767
Unverified
Commit
86fc8767
authored
1 year ago
by
BITARD Michaël
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
chore(ui): update @storybook/testing-vue3 to support storybook 7 (#621)
parent
b9e3aa3f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
package-lock.json
+9875
-25548
9875 additions, 25548 deletions
package-lock.json
packages/ui/package.json
+1
-1
1 addition, 1 deletion
packages/ui/package.json
packages/ui/src/storybook.spec.ts
+3
-4
3 additions, 4 deletions
packages/ui/src/storybook.spec.ts
with
9879 additions
and
25553 deletions
package-lock.json
+
9875
−
25548
View file @
86fc8767
This diff is collapsed.
Click to expand it.
packages/ui/package.json
+
1
−
1
View file @
86fc8767
...
...
@@ -31,7 +31,7 @@
"@storybook/addon-styling"
:
"^1.3.0"
,
"@storybook/builder-vite"
:
"^7.0.22"
,
"@storybook/testing-library"
:
"^0.2.0"
,
"@storybook/testing-vue3"
:
"^0.0
.2
"
,
"@storybook/testing-vue3"
:
"^
1.
0.0"
,
"@storybook/vue3"
:
"^7.0.22"
,
"@storybook/vue3-vite"
:
"^7.0.22"
,
"@testing-library/vue"
:
"^7.0.0"
,
...
...
This diff is collapsed.
Click to expand it.
packages/ui/src/storybook.spec.ts
+
3
−
4
View file @
86fc8767
...
...
@@ -2,7 +2,6 @@ import { describe, expect, test, vi } from 'vitest'
import
type
{
Meta
,
StoryFn
}
from
'
@storybook/vue3
'
import
{
render
}
from
'
@testing-library/vue
'
import
{
composeStories
}
from
'
@storybook/testing-vue3
'
import
type
{
ContextedStory
}
from
'
@storybook/testing-vue3/dist/types
'
import
{
h
}
from
'
vue
'
type
StoryFile
=
{
...
...
@@ -26,9 +25,8 @@ vi.mock('vue-router', () => ({
vi
.
mock
(
'
vuex
'
,
()
=>
({
useStore
:
vi
.
fn
()
}))
const
compose
=
(
entry
:
StoryFile
)
=>
{
const
compose
=
(
entry
:
StoryFile
)
:
ReturnType
<
typeof
composeStories
<
StoryFile
>>
=>
{
try
{
// @ts-ignore waiting for https://github.com/storybookjs/testing-vue3/issues/10
return
composeStories
(
entry
)
}
catch
(
e
)
{
throw
new
Error
(
`Un fichier est probablement mal formaté
${
JSON
.
stringify
(
entry
)}
,
${
e
}
`
)
...
...
@@ -42,7 +40,7 @@ describe('Storybook Tests', async () => {
})
)(
'
$name
'
,
({
name
,
storyFile
,
filePath
})
=>
{
test
.
skipIf
(
name
?.
includes
(
'
NoStoryshots
'
)).
each
(
Object
.
entries
<
ContextedStory
<
unknown
>>
(
compose
(
storyFile
))
Object
.
entries
(
compose
(
storyFile
))
.
map
(([
name
,
story
])
=>
({
name
,
story
}))
.
filter
(
env
=>
name
?.
includes
(
'
NoStoryshots
'
)
||
!
env
.
name
?.
includes
(
'
NoSnapshot
'
))
)(
'
$name
'
,
async
value
=>
{
...
...
@@ -53,6 +51,7 @@ describe('Storybook Tests', async () => {
components
:
{
'
router-link
'
:
(
props
,
{
slots
})
=>
h
(
'
a
'
,
{
...
props
,
type
:
'
primary
'
,
to
:
JSON
.
stringify
(
props
.
to
).
replaceAll
(
'
"
'
,
''
)
},
slots
)
},
},
})
await
new
Promise
<
void
>
(
resolve
=>
setTimeout
(()
=>
resolve
(),
1
))
expect
(
mounted
.
html
()).
toMatchFileSnapshot
(
`./
${
filePath
.
replace
(
/
\.[^/
.
]
+$/
,
''
)}
_snapshots_
${
value
.
name
}
.html`
)
})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment