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:
+16
-16
@@ -1,12 +1,12 @@
|
||||
import type { ComponentProps } from 'react'
|
||||
import type { Meta, StoryObj } from '@storybook/nextjs-vite'
|
||||
import { fn, expect } from 'storybook/test'
|
||||
import { SelectPaymentMethod } from './index'
|
||||
import { PaymentMethodEnum } from '@scandic-hotels/common/constants/paymentMethod'
|
||||
import { FormDecorator } from '../../../../.storybook/decorators/FormDecorator'
|
||||
import type { ComponentProps } from "react"
|
||||
import type { Meta, StoryObj } from "@storybook/nextjs-vite"
|
||||
import { fn, expect } from "storybook/test"
|
||||
import { SelectPaymentMethod } from "./index"
|
||||
import { PaymentMethodEnum } from "@scandic-hotels/common/constants/paymentMethod"
|
||||
import { FormDecorator } from "../../../../.storybook/decorators/FormDecorator"
|
||||
|
||||
const meta: Meta<typeof SelectPaymentMethod> = {
|
||||
title: 'Patterns/Form/Payment/SelectCreditCard',
|
||||
title: "Patterns/Form/Payment/SelectCreditCard",
|
||||
component: SelectPaymentMethod,
|
||||
argTypes: {},
|
||||
decorators: [FormDecorator],
|
||||
@@ -18,30 +18,30 @@ type Story = StoryObj<typeof SelectPaymentMethod>
|
||||
|
||||
export const PrimaryDefault: Story = {
|
||||
args: {
|
||||
formName: 'paymentMethod',
|
||||
formName: "paymentMethod",
|
||||
onChange: fn(),
|
||||
paymentMethods: [
|
||||
{
|
||||
id: 'klarna',
|
||||
alias: 'Card 1',
|
||||
id: "klarna",
|
||||
alias: "Card 1",
|
||||
cardType: PaymentMethodEnum.klarna,
|
||||
truncatedNumber: '1234',
|
||||
truncatedNumber: "1234",
|
||||
},
|
||||
{
|
||||
id: 'applePay',
|
||||
alias: 'Card 2',
|
||||
id: "applePay",
|
||||
alias: "Card 2",
|
||||
cardType: PaymentMethodEnum.applePay,
|
||||
truncatedNumber: '1234',
|
||||
truncatedNumber: "1234",
|
||||
},
|
||||
],
|
||||
} satisfies ComponentProps<typeof SelectPaymentMethod>,
|
||||
|
||||
play: async ({ canvas, userEvent, args }) => {
|
||||
const options = await canvas.findAllByRole('radio')
|
||||
const options = await canvas.findAllByRole("radio")
|
||||
expect(options[0]).toBeInTheDocument()
|
||||
|
||||
expect(args.onChange).not.toHaveBeenCalled()
|
||||
await userEvent.click(options[0])
|
||||
expect(args.onChange).toHaveBeenCalledWith('klarna')
|
||||
expect(args.onChange).toHaveBeenCalledWith("klarna")
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user