Skip to content

Commit

Permalink
Add a story with a long source title
Browse files Browse the repository at this point in the history
  • Loading branch information
obulat committed Aug 16, 2023
1 parent 495ccf5 commit ab5cd5c
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 8 deletions.
Expand Up @@ -12,6 +12,13 @@ export const Template = (args) => ({
template: `<div class="wrapper w-full p-2"><VCollectionHeader v-bind="args"/></div>`,
components: { VCollectionHeader },
setup() {
const collectionId = args.id || "tag"
const defaultCollectionArgs = collections.find((c) => c.id === collectionId)
for (let key of ["collection", "title", "url", "resultsLabel"]) {
if (args[key] === undefined) {
args[key] = defaultCollectionArgs[key]
}
}
return { args }
},
})
Expand All @@ -36,8 +43,8 @@ export const AllCollectionsTemplate = (args) => ({
title="Components/VCollectionHeader"
component={VCollectionHeader}
argTypes={{
collection: {
options: ["tag", "source", "creator"],
id: {
options: ["tag", "source", "creator", "source-with-long-name"],
control: { type: "select" },
},
title: {
Expand All @@ -51,31 +58,40 @@ export const AllCollectionsTemplate = (args) => ({
},
}}
args={{
collection: "source",
title: "Metropolitan Museum of Art",
url: "https://www.metmuseum.org/",
resultsLabel: "10000 images from the Metropolitan Museum of Art",
id: "source-with-long-name",
}}
/>

export const collections = [
{
id: "tag",
collection: "tag",
title: "cat",
resultsLabel: "10000 audio files with the selected tag",
},
{
id: "source",
collection: "source",
title: "Metropolitan Museum of Art",
url: "https://www.metmuseum.org/",
resultsLabel: "10000 images from the Metropolitan Museum of Art",
},
{
id: "creator",
collection: "creator",
title: "iocyoungreporters",
url: "https://www.flickr.com/photos/126018610@N05",
resultsLabel: "10000 images from iocyoungreporters",
},
{
id: "source-with-long-name",
collection: "source",
title:
"Smithsonian Institution: National Museum of African American History and Culture",
url: "https://nmaahc.si.edu",
resultsLabel:
"10000 images from the Smithsonian Institution: National Museum of African American History and Culture",
},
]

# VCollectionHeader
Expand Down
Expand Up @@ -5,10 +5,15 @@ import breakpoints from "~~/test/playwright/utils/breakpoints"
test.describe("VCollectionHeader", () => {
breakpoints.describeMobileAndDesktop(({ expectSnapshot }) => {
for (const languageDirection of ["ltr", "rtl"]) {
for (const collection of ["tag", "creator", "source"]) {
for (const collection of [
"tag",
"creator",
"source",
"source-with-long-name",
]) {
test(`${collection}-${languageDirection}`, async ({ page }) => {
await page.goto(
`/iframe.html?id=components-vcollectionheader--default-story&args=collection:${collection}`
`/iframe.html?id=components-vcollectionheader--default-story&args=id:${collection}`
)
await expectSnapshot(
`VCollectionHeader=${collection}-${languageDirection}`,
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ab5cd5c

Please sign in to comment.