Merged in fix/3697-prettier-configs (pull request #3396)
fix(SW-3691): Setup one prettier config for whole repo * Setup prettierrc in root and remove other configs Approved-by: Joakim Jäderberg Approved-by: Linus Flood
This commit is contained in:
@@ -1,27 +1,27 @@
|
||||
import type { Meta, StoryObj } from '@storybook/nextjs-vite'
|
||||
import type { Meta, StoryObj } from "@storybook/nextjs-vite"
|
||||
|
||||
import { PaymentMethodIcon } from './PaymentMethodIcon'
|
||||
import { PaymentMethodEnum } from '@scandic-hotels/common/constants/paymentMethod'
|
||||
import { Typography } from '../Typography'
|
||||
import { expect } from 'storybook/test'
|
||||
import { PaymentMethodIcon } from "./PaymentMethodIcon"
|
||||
import { PaymentMethodEnum } from "@scandic-hotels/common/constants/paymentMethod"
|
||||
import { Typography } from "../Typography"
|
||||
import { expect } from "storybook/test"
|
||||
|
||||
const methods = Object.values(PaymentMethodEnum).toSorted()
|
||||
|
||||
const meta: Meta<typeof PaymentMethodIcon> = {
|
||||
title: 'Product Components/Payment/PaymentMethodIcon',
|
||||
title: "Product Components/Payment/PaymentMethodIcon",
|
||||
component: PaymentMethodIcon,
|
||||
parameters: {
|
||||
layout: 'centered',
|
||||
layout: "centered",
|
||||
},
|
||||
argTypes: {
|
||||
paymentMethod: {
|
||||
control: { type: 'select' },
|
||||
control: { type: "select" },
|
||||
options: methods,
|
||||
description: 'Payment method to display',
|
||||
description: "Payment method to display",
|
||||
},
|
||||
alt: {
|
||||
control: { type: 'text' },
|
||||
description: 'Alt text for the icon',
|
||||
control: { type: "text" },
|
||||
description: "Alt text for the icon",
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -32,25 +32,25 @@ type Story = StoryObj<typeof PaymentMethodIcon>
|
||||
export const Playground: Story = {
|
||||
args: {
|
||||
paymentMethod: PaymentMethodEnum.visa,
|
||||
alt: 'Visa payment method',
|
||||
alt: "Visa payment method",
|
||||
},
|
||||
play: async ({ canvas, args }) => {
|
||||
const img = await canvas.findByRole('img')
|
||||
const img = await canvas.findByRole("img")
|
||||
|
||||
expect(img).toBeInTheDocument()
|
||||
expect(img).toHaveAttribute('alt', args.alt)
|
||||
expect(img).toHaveAttribute("alt", args.alt)
|
||||
},
|
||||
}
|
||||
|
||||
export const All: Story = {
|
||||
parameters: {
|
||||
layout: 'padded',
|
||||
layout: "padded",
|
||||
},
|
||||
render: (args) => (
|
||||
<div
|
||||
style={{
|
||||
display: 'grid',
|
||||
gridTemplateColumns: 'repeat(auto-fill, minmax(80px, 1fr))',
|
||||
display: "grid",
|
||||
gridTemplateColumns: "repeat(auto-fill, minmax(80px, 1fr))",
|
||||
gap: 16,
|
||||
}}
|
||||
>
|
||||
@@ -58,10 +58,10 @@ export const All: Story = {
|
||||
<div
|
||||
key={m}
|
||||
style={{
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
gap: 12,
|
||||
padding: 8,
|
||||
borderRadius: 8,
|
||||
|
||||
Reference in New Issue
Block a user