Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Create a new `VIconButton` (#2697)

Olga Bulat969f75b1ea50
diff --git a/frontend/src/components/VAudioTrack/VPlayPause.vue b/frontend/src/components/VAudioTrack/VPlayPause.vue
index 7a831ef81..b994e522e 100644
--- a/frontend/src/components/VAudioTrack/VPlayPause.vue
+++ b/frontend/src/components/VAudioTrack/VPlayPause.vue
@@ -1,5 +1,5 @@
<template>
- <VIconButton
+ <VOldIconButton
v-bind="$attrs"
:tabindex="isTabbable ? 0 : -1"
class="play-pause flex-shrink-0 border-dark-charcoal bg-dark-charcoal text-white focus-visible:border-pink focus-visible:shadow-ring focus-visible:outline-none active:shadow-ring disabled:opacity-70"
@@ -26,7 +26,7 @@
/>
</svg>
</template>
- </VIconButton>
+ </VOldIconButton>
</template>
<script lang="ts">
@@ -36,7 +36,7 @@ import { AudioLayout, AudioStatus, statusVerbMap } from "~/constants/audio"
import { defineEvent } from "~/types/emits"
import type { ButtonConnections, ButtonVariant } from "~/types/button"
-import VIconButton from "~/components/VIconButton/VIconButton.vue"
+import VOldIconButton from "~/components/VIconButton/VOldIconButton.vue"
const statusIconMap = {
playing: "pause",
@@ -58,7 +58,7 @@ const layoutConnectionsMap: Record<AudioLayout, ButtonConnections> = {
*/
export default defineComponent({
name: "VPlayPause",
- components: { VIconButton },
+ components: { VOldIconButton },
inheritAttrs: false,
model: {
prop: "status",
diff --git a/frontend/src/components/VAudioTrack/meta/VPlayPause.stories.mdx b/frontend/src/components/VAudioTrack/meta/VPlayPause.stories.mdx
index 3414126c5..880eb71b0 100644
--- a/frontend/src/components/VAudioTrack/meta/VPlayPause.stories.mdx
+++ b/frontend/src/components/VAudioTrack/meta/VPlayPause.stories.mdx
@@ -48,7 +48,7 @@ value of its `status` state.
## Size
The button dimensions can be set by passing the `size` prop (see
-[`VIconButton` docs](?path=/docs/components-viconbutton--default-story)).
+[`VOldIconButton` docs](?path=/docs/components-voldiconbutton--default-story)).
<Canvas>
<Story
diff --git a/frontend/src/components/VButton.vue b/frontend/src/components/VButton.vue
index e8a2abc05..1119646fd 100644
--- a/frontend/src/components/VButton.vue
+++ b/frontend/src/components/VButton.vue
@@ -6,7 +6,7 @@
:class="[
$style.button,
$style[variant],
- $style[`size-${size}`],
+ $style[`size-${size}${iconOnly ? '-icon-only' : ''}`],
{
[$style[`${variant}-pressed`]]: isActive,
[$style[`connection-${connections}`]]: isConnected,
@@ -184,6 +184,13 @@ const VButton = defineComponent({
type: Boolean,
default: false,
},
+ /**
+ * If the button is only an icon, width is set to height, and padding is removed.
+ */
+ iconOnly: {
+ type: Boolean,
+ default: false,
+ },
},
setup(props, { attrs }) {
const propsRef = toRefs(props)
@@ -284,6 +291,9 @@ export default VButton
.size-small {
@apply h-8 px-2 py-0;
}
+.size-small-icon-only {
+ @apply h-8 w-8 p-0;
+}
.icon-start-small {
@apply ps-1;
}
@@ -294,6 +304,9 @@ export default VButton
.size-medium {
@apply h-10 px-3 py-0;
}
+.size-medium-icon-only {
+ @apply h-10 w-10 p-0;
+}
.icon-start-medium {
@apply ps-2;
}
@@ -304,6 +317,9 @@ export default VButton
.size-large {
@apply h-12 px-5 py-0;
}
+.size-large-icon-only {
+ @apply h-12 w-12 p-0;
+}
.icon-start-large {
@apply ps-4;
}
@@ -331,10 +347,6 @@ a.button {
@apply border-tx bg-white text-dark-charcoal hover:bg-dark-charcoal hover:text-white;
}
-.filled-transparent {
- @apply border-tx bg-tx text-curr hover:bg-dark-charcoal hover:text-white;
-}
-
.bordered-white {
@apply border-white bg-white text-dark-charcoal hover:border-dark-charcoal-20;
}
diff --git a/frontend/src/components/VCloseButton.vue b/frontend/src/components/VCloseButton.vue
index 12d149f0c..53c440e7e 100644
--- a/frontend/src/components/VCloseButton.vue
+++ b/frontend/src/components/VCloseButton.vue
@@ -1,5 +1,5 @@
<template>
- <VIconButton
+ <VOldIconButton
:button-props="buttonProps"
:icon-props="iconProps"
:borderless="true"
@@ -19,14 +19,14 @@ import { computed, defineComponent, PropType } from "vue"
import type { ButtonVariant } from "~/types/button"
-import VIconButton from "~/components/VIconButton/VIconButton.vue"
+import VOldIconButton from "~/components/VIconButton/VOldIconButton.vue"
import type { TranslateResult } from "vue-i18n"
type CloseButtonVariant =
| "filled-white"
| "filled-white-light"
- | "filled-transparent"
+ | "transparent-dark"
| "transparent-gray"
| "filled-dark"
| "black"
@@ -39,7 +39,7 @@ type CloseButtonVariant =
*/
export default defineComponent({
name: "VCloseButton",
- components: { VIconButton },
+ components: { VOldIconButton },
props: {
label: {
type: [String, Object] as PropType<string | TranslateResult>,
@@ -59,7 +59,7 @@ export default defineComponent({
default: "filled-white-light",
},
/**
- * The size of the underlying VIconButton.
+ * The size of the underlying VOldIconButton.
*/
size: {
type: String as PropType<"close" | "small" | "medium" | "large">,
diff --git a/frontend/src/components/VGlobalAudioSection/VGlobalAudioSection.vue b/frontend/src/components/VGlobalAudioSection/VGlobalAudioSection.vue
index 8c2e5d5fd..29c792100 100644
--- a/frontend/src/components/VGlobalAudioSection/VGlobalAudioSection.vue
+++ b/frontend/src/components/VGlobalAudioSection/VGlobalAudioSection.vue
@@ -4,7 +4,7 @@
<VCloseButton
v-if="audio"
class="!absolute end-0 top-0 z-30"
- variant="filled-transparent"
+ variant="transparent-dark"
size="large"
:label="$t('audioTrack.close')"
@close="handleClose"
diff --git a/frontend/src/components/VHeader/VHeaderInternal.vue b/frontend/src/components/VHeader/VHeaderInternal.vue
index cee080a64..5bc209722 100644
--- a/frontend/src/components/VHeader/VHeaderInternal.vue
+++ b/frontend/src/components/VHeader/VHeaderInternal.vue
@@ -12,7 +12,7 @@
/>
</nav>
<div class="flex lg:hidden">
- <VIconButton
+ <VOldIconButton
id="menu-button"
ref="menuButtonRef"
:icon-props="{ name: 'menu' }"
@@ -94,7 +94,7 @@ import { useUiStore } from "~/stores/ui"
import VCloseButton from "~/components/VCloseButton.vue"
import VHomeLink from "~/components/VHeader/VHomeLink.vue"
-import VIconButton from "~/components/VIconButton/VIconButton.vue"
+import VOldIconButton from "~/components/VIconButton/VOldIconButton.vue"
import VPageLinks from "~/components/VHeader/VPageLinks.vue"
import VModalContent from "~/components/VModal/VModalContent.vue"
import VPopoverContent from "~/components/VPopover/VPopoverContent.vue"
@@ -107,12 +107,12 @@ export default defineComponent({
VModalContent,
VPopoverContent,
VHomeLink,
- VIconButton,
+ VOldIconButton,
VPageLinks,
VWordPressLink,
},
setup(_, { emit }) {
- const menuButtonRef = ref<InstanceType<typeof VIconButton> | null>(null)
+ const menuButtonRef = ref<InstanceType<typeof VOldIconButton> | null>(null)
const nodeRef = ref<HTMLElement | null>(null)
const modalContentRef = ref<InstanceType<typeof VModalContent> | null>(null)
diff --git a/frontend/src/components/VHeader/VHeaderMobile/VSearchBarButton.vue b/frontend/src/components/VHeader/VHeaderMobile/VSearchBarButton.vue
index d4e35cafb..fc4405e3a 100644
--- a/frontend/src/components/VHeader/VHeaderMobile/VSearchBarButton.vue
+++ b/frontend/src/components/VHeader/VHeaderMobile/VSearchBarButton.vue
@@ -1,5 +1,5 @@
<template>
- <VIconButton
+ <VOldIconButton
class="border-tx bg-tx"
:label="label"
:button-props="{ variant: 'plain--avoid' }"
@@ -20,25 +20,25 @@
<slot name="notification" />
</span>
</template>
- </VIconButton>
+ </VOldIconButton>
</template>
<script lang="ts">
import { defineComponent, PropType } from "vue"
import VIcon from "~/components/VIcon/VIcon.vue"
-import VIconButton from "~/components/VIconButton/VIconButton.vue"
+import VOldIconButton from "~/components/VIconButton/VOldIconButton.vue"
import type { TranslateResult } from "vue-i18n"
/**
* The buttons placed inside the mobile search bar in the header.
- * They are based on the VIconButton, look like they have a smallish focus area
+ * They are based on the VOldIconButton, look like they have a smallish focus area
* (32x32px), but actually have a larger tappable area of 48x48px to comply with
* accessibility requirements.
*/
export default defineComponent({
name: "VSearchBarButton",
- components: { VIcon, VIconButton },
+ components: { VIcon, VOldIconButton },
props: {
/**
* The path for the icon.
diff --git a/frontend/src/components/VHeader/VLogoButton.vue b/frontend/src/components/VHeader/VLogoButton.vue
index 62f8f2c90..4ec729c52 100644
--- a/frontend/src/components/VHeader/VLogoButton.vue
+++ b/frontend/src/components/VHeader/VLogoButton.vue
@@ -4,8 +4,9 @@
href="/"
:aria-label="$t('header.homeLink', { openverse: 'Openverse' }).toString()"
variant="transparent-tx"
- size="disabled"
- class="h-12 w-12 text-dark-charcoal hover:bg-yellow"
+ size="large"
+ icon-only
+ class="text-dark-charcoal hover:bg-yellow"
>
<VLogoLoader
:status="isFetching ? 'loading' : 'idle'"
diff --git a/frontend/src/components/VIconButton/VIconButton.vue b/frontend/src/components/VIconButton/VIconButton.vue
index 31bd2b5b1..4744ec4e8 100644
--- a/frontend/src/components/VIconButton/VIconButton.vue
+++ b/frontend/src/components/VIconButton/VIconButton.vue
@@ -1,100 +1,69 @@
<template>
<VButton
- v-bind="buttonProps"
:aria-label="label"
- size="disabled"
- class="icon-button flex flex-shrink-0 flex-grow-0 items-center justify-center"
- :class="[buttonSizeClasses, { 'border-1.5': !borderless }]"
- :type="type"
+ :size="size"
+ :variant="variant"
+ class="icon-button"
+ icon-only
v-on="$listeners"
>
- <slot name="default" :icon-size="iconSize" />
+ <slot name="default" :icon-size="6" />
<VIcon
v-if="iconProps"
class="pointer-events-none"
- :size="iconSize"
+ :size="6"
v-bind="iconProps"
/>
</VButton>
</template>
<script lang="ts">
-import { computed, defineComponent, PropType } from "vue"
+import { defineComponent, PropType } from "vue"
-import type { ButtonType } from "~/types/button"
+import type { ButtonSize, ButtonVariant } from "~/types/button"
import VIcon, { type IconProps } from "~/components/VIcon/VIcon.vue"
-import VButton, { type ButtonProps } from "~/components/VButton.vue"
+import VButton from "~/components/VButton.vue"
import type { TranslateResult } from "vue-i18n"
-const SIZE_MAP = Object.freeze({
- tiny: { icon: 6, button: "w-6 h-6" },
- close: { icon: 6, button: "w-8 h-8" },
- small: { icon: 6, button: "w-10 h-10" },
- medium: { icon: 6, button: "w-12 h-12" },
- large: { icon: 8, button: "w-14 h-14" },
- "extra-large": { icon: 12, button: "w-20 h-20" },
-} as const)
-type Size = keyof typeof SIZE_MAP
-
+/**
+ * The icon-only version of VButton component. In some cases, VButton is replaced
+ * with VIconButton in small breakpoints.
+ */
export default defineComponent({
name: "VIconButton",
components: { VIcon, VButton },
props: {
/**
- * the size of the button; The size affects both the size of the button
- * itself and the icon inside it.
+ * The size of the button, matches the sizes of VButton component.
*/
size: {
- type: String as PropType<Size>,
- default: "medium",
- validator: (val: string) => Object.keys(SIZE_MAP).includes(val),
+ type: String as PropType<Exclude<ButtonSize, "disabled">>,
+ required: true,
},
/**
- * props to pass down to the `VIcon` component nested inside the button; See
- * documentation on `VIcon`.
+ * The visual variant of the button, matches the variants of VButton component.
*/
- iconProps: {
- type: Object as PropType<IconProps>,
- required: false,
+ variant: {
+ type: String as PropType<ButtonVariant>,
+ required: true,
},
/**
- * props to pass down to the `VButton` component nested inside the button;
- * See documentation on `VButton`.
+ * Props to pass down to the `VIcon` component nested inside the button.
+ * See documentation on `VIcon`.
*/
- buttonProps: {
- type: Object as PropType<Omit<ButtonProps, "size">>,
- default: () => ({ variant: "transparent-tx" }),
+ iconProps: {
+ type: Object as PropType<IconProps>,
+ required: false,
},
/**
- * the label for the button; This is used for accessibility purposes.
+ * The label used for accessibility purposes.
*/
label: {
type: [String, Object] as PropType<string | TranslateResult>,
required: true,
},
- /**
- * whether the button should have a border or not.
- * The `focus-` custom TW classes don't always work well with border.
- */
- borderless: {
- type: Boolean,
- default: false,
- },
- },
- setup(props, { attrs }) {
- const type = (attrs["type"] ?? "button") as ButtonType
-
- const buttonSizeClasses = computed(() => SIZE_MAP[props.size].button)
- const iconSize = computed(() => SIZE_MAP[props.size].icon)
-
- return {
- type,
-
- buttonSizeClasses,
- iconSize,
- }
},
})
</script>
diff --git a/frontend/src/components/VIconButton/VOldIconButton.vue b/frontend/src/components/VIconButton/VOldIconButton.vue
new file mode 100644
index 000000000..83d864cb6
--- /dev/null
+++ b/frontend/src/components/VIconButton/VOldIconButton.vue
@@ -0,0 +1,100 @@
+<template>
+ <VButton
+ v-bind="buttonProps"
+ :aria-label="label"
+ size="disabled"
+ class="icon-button flex flex-shrink-0 flex-grow-0 items-center justify-center"
+ :class="[buttonSizeClasses, { 'border-1.5': !borderless }]"
+ :type="type"
+ v-on="$listeners"
+ >
+ <slot name="default" :icon-size="iconSize" />
+ <VIcon
+ v-if="iconProps"
+ class="pointer-events-none"
+ :size="iconSize"
+ v-bind="iconProps"
+ />
+ </VButton>
+</template>
+
+<script lang="ts">
+import { computed, defineComponent, PropType } from "vue"
+
+import type { ButtonType } from "~/types/button"
+
+import VIcon, { type IconProps } from "~/components/VIcon/VIcon.vue"
+import VButton, { type ButtonProps } from "~/components/VButton.vue"
+
+import type { TranslateResult } from "vue-i18n"
+
+const SIZE_MAP = Object.freeze({
+ tiny: { icon: 6, button: "w-6 h-6" },
+ close: { icon: 6, button: "w-8 h-8" },
+ small: { icon: 6, button: "w-10 h-10" },
+ medium: { icon: 6, button: "w-12 h-12" },
+ large: { icon: 8, button: "w-14 h-14" },
+ "extra-large": { icon: 12, button: "w-20 h-20" },
+} as const)
+type Size = keyof typeof SIZE_MAP
+
+export default defineComponent({
+ name: "VOldIconButton",
+ components: { VIcon, VButton },
+ props: {
+ /**
+ * the size of the button; The size affects both the size of the button
+ * itself and the icon inside it.
+ */
+ size: {
+ type: String as PropType<Size>,
+ default: "medium",
+ validator: (val: string) => Object.keys(SIZE_MAP).includes(val),
+ },
+ /**
+ * props to pass down to the `VIcon` component nested inside the button; See
+ * documentation on `VIcon`.
+ */
+ iconProps: {
+ type: Object as PropType<IconProps>,
+ required: false,
+ },
+ /**
+ * props to pass down to the `VButton` component nested inside the button;
+ * See documentation on `VButton`.
+ */
+ buttonProps: {
+ type: Object as PropType<Omit<ButtonProps, "size">>,
+ default: () => ({ variant: "transparent-tx" }),
+ },
+ /**
+ * the label for the button; This is used for accessibility purposes.
+ */
+ label: {
+ type: [String, Object] as PropType<string | TranslateResult>,
+ required: true,
+ },
+ /**
+ * whether the button should have a border or not.
+ * The `focus-` custom TW classes don't always work well with border.
+ */
+ borderless: {
+ type: Boolean,
+ default: false,
+ },
+ },
+ setup(props, { attrs }) {
+ const type = (attrs["type"] ?? "button") as ButtonType
+
+ const buttonSizeClasses = computed(() => SIZE_MAP[props.size].button)
+ const iconSize = computed(() => SIZE_MAP[props.size].icon)
+
+ return {
+ type,
+
+ buttonSizeClasses,
+ iconSize,
+ }
+ },
+})
+</script>
diff --git a/frontend/src/components/VIconButton/meta/VIconButton.stories.mdx b/frontend/src/components/VIconButton/meta/VIconButton.stories.mdx
index 7a4fdd5c6..68327e342 100644
--- a/frontend/src/components/VIconButton/meta/VIconButton.stories.mdx
+++ b/frontend/src/components/VIconButton/meta/VIconButton.stories.mdx
@@ -7,22 +7,27 @@ import {
} from "@storybook/addon-docs"
import VIconButton from "~/components/VIconButton/VIconButton.vue"
+import { baseButtonSizes, baseButtonVariants } from "~/types/button"
<Meta
title="Components/VIconButton"
component={VIconButton}
argTypes={{
size: {
- defaultValue: "medium",
- options: ["tiny", "small", "medium", "large", "extra-large"],
+ options: baseButtonSizes,
control: "select",
},
+ variant: {
+ options: baseButtonVariants,
+ control: "select",
+ },
+ click: { action: "click" },
}}
/>
export const Template = (args) => ({
template: `
- <VIconButton class="text-white bg-dark-charcoal border-dark-charcoal" v-bind="args" label="v-icon-button" />
+ <VIconButton v-bind="args" v-on="args" label="v-icon-button" />
`,
components: { VIconButton },
setup() {
@@ -33,17 +38,20 @@ export const Template = (args) => ({
export const sizesTemplate = (args) => ({
template: `
<div class="flex gap-x-2">
- <div v-for="size in ['tiny', 'small', 'medium', 'large', 'extra-large']" :key="size" class="flex flex-col items-center p-2">
- <p>{{ size }}</p>
+ <div v-for="size in args.baseButtonSizes" :key="size" class="flex flex-col items-center p-2 gap-2">
+ <p class="label-bold">{{ size }}</p>
<VIconButton
- class="text-white bg-dark-charcoal border-dark-charcoal"
label="v-icon-button"
- :size="size" v-bind="args" />
+ :size="size"
+ v-bind="args"
+ v-on="args"
+ />
</div>
</div>
`,
components: { VIconButton },
setup() {
+ args.baseButtonSizes = baseButtonSizes
return { args }
},
})
@@ -58,6 +66,8 @@ export const sizesTemplate = (args) => ({
<Story
name="Default"
args={{
+ variant: "filled-dark",
+ size: "medium",
iconProps: {
name: "replay",
},
@@ -73,6 +83,8 @@ export const sizesTemplate = (args) => ({
<Story
name="Sizes"
args={{
+ variant: "filled-dark",
+ size: "small",
iconProps: {
name: "replay",
},
diff --git a/frontend/src/components/VIconButton/meta/VOldIconButton.stories.mdx b/frontend/src/components/VIconButton/meta/VOldIconButton.stories.mdx
new file mode 100644
index 000000000..173f6be94
--- /dev/null
+++ b/frontend/src/components/VIconButton/meta/VOldIconButton.stories.mdx
@@ -0,0 +1,83 @@
+import {
+ ArgsTable,
+ Canvas,
+ Description,
+ Meta,
+ Story,
+} from "@storybook/addon-docs"
+
+import VOldIconButton from "~/components/VIconButton/VOldIconButton.vue"
+
+<Meta
+ title="Components/VOldIconButton"
+ component={VOldIconButton}
+ argTypes={{
+ size: {
+ defaultValue: "medium",
+ options: ["tiny", "small", "medium", "large", "extra-large"],
+ control: "select",
+ },
+ }}
+/>
+
+export const Template = (args) => ({
+ template: `
+ <VOldIconButton class="text-white bg-dark-charcoal border-dark-charcoal" v-bind="args" label="v-icon-button" />
+ `,
+ components: { VOldIconButton },
+ setup() {
+ return { args }
+ },
+})
+
+export const sizesTemplate = (args) => ({
+ template: `
+ <div class="flex gap-x-2">
+ <div v-for="size in ['tiny', 'small', 'medium', 'large', 'extra-large']" :key="size" class="flex flex-col items-center p-2">
+ <p>{{ size }}</p>
+ <VOldIconButton
+ class="text-white bg-dark-charcoal border-dark-charcoal"
+ label="v-icon-button"
+ :size="size" v-bind="args" />
+ </div>
+ </div>
+ `,
+ components: { VOldIconButton },
+ setup() {
+ return { args }
+ },
+})
+
+# Icon Button
+
+<Description of={VOldIconButton} />
+
+<ArgsTable of={VOldIconButton} />
+
+<Canvas>
+ <Story
+ name="Default"
+ args={{
+ iconProps: {
+ name: "replay",
+ },
+ }}
+ >
+ {Template.bind({})}
+ </Story>
+</Canvas>
+
+## Sizes
+
+<Canvas>
+ <Story
+ name="Sizes"
+ args={{
+ iconProps: {
+ name: "replay",
+ },
+ }}
+ >
+ {sizesTemplate.bind({})}
+ </Story>
+</Canvas>
diff --git a/frontend/src/components/meta/VCloseButton.stories.mdx b/frontend/src/components/meta/VCloseButton.stories.mdx
index de5c776ec..5a86dc935 100644
--- a/frontend/src/components/meta/VCloseButton.stories.mdx
+++ b/frontend/src/components/meta/VCloseButton.stories.mdx
@@ -12,7 +12,6 @@ import VCloseButton from "~/components/VCloseButton.vue"
export const buttonVariants = [
"filled-white",
"filled-white-light",
- "filled-transparent",
"filled-dark",
"black",
]
diff --git a/frontend/src/types/button.ts b/frontend/src/types/button.ts
index e44e1d8af..394076d81 100644
--- a/frontend/src/types/button.ts
+++ b/frontend/src/types/button.ts
@@ -2,25 +2,32 @@ export const buttonForms = ["VLink", "button"] as const
export type ButtonForm = (typeof buttonForms)[number]
-export const buttonVariants = [
- "plain",
- "plain--avoid",
- "dropdown-label",
- "dropdown-label-pressed",
+export const baseButtonVariants = [
"filled-pink",
"filled-dark",
"filled-gray",
"filled-white",
- "filled-transparent",
"bordered-white",
"bordered-gray",
"transparent-tx",
"transparent-gray",
"transparent-dark",
] as const
+export type StandardButtonVariant = (typeof baseButtonVariants)[number]
+
+export const buttonVariants = [
+ ...baseButtonVariants,
+ "plain",
+ "plain--avoid",
+ "dropdown-label",
+ "dropdown-label-pressed",
+] as const
export type ButtonVariant = (typeof buttonVariants)[number]
-export const buttonSizes = ["large", "medium", "small", "disabled"] as const
+export const baseButtonSizes = ["large", "medium", "small"] as const
+export type BaseButtonSize = (typeof baseButtonSizes)[number]
+
+export const buttonSizes = [...baseButtonSizes, "disabled"] as const
export type ButtonSize = (typeof buttonSizes)[number]
export const buttonTypes = ["button", "submit", "reset"] as const
diff --git a/frontend/test/playwright/e2e/load-more.spec.ts b/frontend/test/playwright/e2e/load-more.spec.ts
index 8521c5cc1..82ee5656b 100644
--- a/frontend/test/playwright/e2e/load-more.spec.ts
+++ b/frontend/test/playwright/e2e/load-more.spec.ts
@@ -2,7 +2,9 @@ import { expect, Page, test } from "@playwright/test"
import {
goToSearchTerm,
+ preparePageForTests,
renderModes,
+ sleep,
t,
} from "~~/test/playwright/utils/navigation"
import { mockProviderApis } from "~~/test/playwright/utils/route"
@@ -142,6 +144,7 @@ test.describe("Load more button", () => {
page,
context,
}) => {
+ await preparePageForTests(page, "xl")
const analyticsEvents = collectAnalyticsEvents(context)
await page.goto("/search/?q=cat")
@@ -149,6 +152,8 @@ test.describe("Load more button", () => {
await page.locator(loadMoreButton).scrollIntoViewIfNeeded()
await expect(page.locator(loadMoreButton)).toBeVisible()
+ await sleep(300)
+
const reachResultEndEvent = analyticsEvents.find(
(event) => event.n === "REACH_RESULT_END"
)
diff --git a/frontend/test/storybook/visual-regression/v-icon-button.spec.ts-snapshots/v-icon-button-sizes-linux.png b/frontend/test/storybook/visual-regression/v-icon-button.spec.ts-snapshots/v-icon-button-sizes-linux.png
index 6a8a22dd9..8824b6a5c 100644
Binary files a/frontend/test/storybook/visual-regression/v-icon-button.spec.ts-snapshots/v-icon-button-sizes-linux.png and b/frontend/test/storybook/visual-regression/v-icon-button.spec.ts-snapshots/v-icon-button-sizes-linux.png differ
diff --git a/frontend/test/storybook/visual-regression/v-old-icon-button.spec.ts b/frontend/test/storybook/visual-regression/v-old-icon-button.spec.ts
new file mode 100644
index 000000000..226c63941
--- /dev/null
+++ b/frontend/test/storybook/visual-regression/v-old-icon-button.spec.ts
@@ -0,0 +1,12 @@
+import { expect, test } from "@playwright/test"
+
+test.describe("VOldIconButton", () => {
+ const url = "/iframe.html?id=components-voldiconbutton--sizes"
+
+ test("old icon button sizes", async ({ page }) => {
+ await page.goto(url)
+ expect(await page.screenshot()).toMatchSnapshot({
+ name: "v-old-icon-button-sizes.png",
+ })
+ })
+})
diff --git a/frontend/test/storybook/visual-regression/v-old-icon-button.spec.ts-snapshots/v-old-icon-button-sizes-linux.png b/frontend/test/storybook/visual-regression/v-old-icon-button.spec.ts-snapshots/v-old-icon-button-sizes-linux.png
new file mode 100644
index 000000000..6a8a22dd9
Binary files /dev/null and b/frontend/test/storybook/visual-regression/v-old-icon-button.spec.ts-snapshots/v-old-icon-button-sizes-linux.png differ