Skip to content

Commit

Permalink
Fix storybook v-image-cell test (#3174)
Browse files Browse the repository at this point in the history
* Use local image for v-image-cell test

* Update snapshots
  • Loading branch information
obulat authored Oct 10, 2023
1 parent 079ad31 commit 9a95495
Show file tree
Hide file tree
Showing 19 changed files with 6 additions and 5 deletions.
6 changes: 5 additions & 1 deletion frontend/src/components/VImageCell/VImageCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ import VLink from "~/components/VLink.vue"
import errorImage from "~/assets/image_not_available_placeholder.png"
const toAbsolutePath = (url: string, prefix = "https://") => {
if (url.indexOf("http://") >= 0 || url.indexOf("https://") >= 0) {
if (
url.startsWith("http://") ||
url.startsWith("https://") ||
url === "/openverse-default.jpg"
) {
return url
}
return `${prefix}${url}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
} from "@storybook/addon-docs"
import VImageCell from "~/components/VImageCell/VImageCell.vue"
import { image } from "~~/test/unit/fixtures/image"
import { base64Image } from "~~/test/unit/fixtures/base64Image"

<Meta title="Components/VImageCell" components={VImageCell} />

Expand Down Expand Up @@ -49,7 +48,7 @@ export const Template = (args, { argTypes }) => ({
}}
args={{
aspectRatio: "intrinsic",
image: { ...image, url: base64Image },
image: { ...image, thumbnail: "/openverse-default.jpg" },
}}
>
{Template.bind({})}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions frontend/test/unit/fixtures/base64Image.js

This file was deleted.

0 comments on commit 9a95495

Please sign in to comment.