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,12 +1,12 @@
|
||||
import type { Meta, StoryObj } from '@storybook/nextjs-vite'
|
||||
import type { Meta, StoryObj } from "@storybook/nextjs-vite"
|
||||
|
||||
import { expect, fn } from 'storybook/test'
|
||||
import { expect, fn } from "storybook/test"
|
||||
|
||||
import { BackToTopButton } from '.'
|
||||
import { config as backToTopButtonConfig } from './variants'
|
||||
import { BackToTopButton } from "."
|
||||
import { config as backToTopButtonConfig } from "./variants"
|
||||
|
||||
const meta: Meta<typeof BackToTopButton> = {
|
||||
title: 'Patterns/BackToTopButton',
|
||||
title: "Patterns/BackToTopButton",
|
||||
component: BackToTopButton,
|
||||
argTypes: {
|
||||
onPress: {
|
||||
@@ -15,13 +15,13 @@ const meta: Meta<typeof BackToTopButton> = {
|
||||
},
|
||||
},
|
||||
position: {
|
||||
control: 'select',
|
||||
control: "select",
|
||||
options: Object.keys(backToTopButtonConfig.variants.position),
|
||||
table: {
|
||||
type: {
|
||||
summary: 'string',
|
||||
summary: "string",
|
||||
detail: Object.keys(backToTopButtonConfig.variants.position).join(
|
||||
' | '
|
||||
" | "
|
||||
),
|
||||
},
|
||||
defaultValue: {
|
||||
@@ -30,7 +30,7 @@ const meta: Meta<typeof BackToTopButton> = {
|
||||
},
|
||||
},
|
||||
label: {
|
||||
control: 'text',
|
||||
control: "text",
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -40,16 +40,16 @@ export default meta
|
||||
type Story = StoryObj<typeof BackToTopButton>
|
||||
|
||||
const globalStoryPropsInverted = {
|
||||
backgrounds: { value: 'scandicPrimaryDark' },
|
||||
backgrounds: { value: "scandicPrimaryDark" },
|
||||
}
|
||||
|
||||
export const Default: Story = {
|
||||
args: {
|
||||
onPress: fn(),
|
||||
label: 'Back to top',
|
||||
label: "Back to top",
|
||||
},
|
||||
play: async ({ canvas, userEvent, args }) => {
|
||||
await userEvent.click(await canvas.findByRole('button'))
|
||||
await userEvent.click(await canvas.findByRole("button"))
|
||||
expect(args.onPress).toHaveBeenCalledTimes(1)
|
||||
},
|
||||
}
|
||||
@@ -57,10 +57,10 @@ export const Default: Story = {
|
||||
export const PositionLeft: Story = {
|
||||
args: {
|
||||
...Default.args,
|
||||
position: 'left',
|
||||
position: "left",
|
||||
},
|
||||
play: async ({ canvas, userEvent, args }) => {
|
||||
await userEvent.click(await canvas.findByRole('button'))
|
||||
await userEvent.click(await canvas.findByRole("button"))
|
||||
expect(args.onPress).toHaveBeenCalledTimes(1)
|
||||
},
|
||||
}
|
||||
@@ -68,10 +68,10 @@ export const PositionLeft: Story = {
|
||||
export const PositionCenter: Story = {
|
||||
args: {
|
||||
...Default.args,
|
||||
position: 'center',
|
||||
position: "center",
|
||||
},
|
||||
play: async ({ canvas, userEvent, args }) => {
|
||||
await userEvent.click(await canvas.findByRole('button'))
|
||||
await userEvent.click(await canvas.findByRole("button"))
|
||||
expect(args.onPress).toHaveBeenCalledTimes(1)
|
||||
},
|
||||
}
|
||||
@@ -79,10 +79,10 @@ export const PositionCenter: Story = {
|
||||
export const PositionRight: Story = {
|
||||
args: {
|
||||
...Default.args,
|
||||
position: 'right',
|
||||
position: "right",
|
||||
},
|
||||
play: async ({ canvas, userEvent, args }) => {
|
||||
await userEvent.click(await canvas.findByRole('button'))
|
||||
await userEvent.click(await canvas.findByRole("button"))
|
||||
expect(args.onPress).toHaveBeenCalledTimes(1)
|
||||
},
|
||||
}
|
||||
@@ -91,10 +91,10 @@ export const OnDarkBackground: Story = {
|
||||
globals: globalStoryPropsInverted,
|
||||
args: {
|
||||
onPress: fn(),
|
||||
label: 'Back to top',
|
||||
label: "Back to top",
|
||||
},
|
||||
play: async ({ canvas, userEvent, args }) => {
|
||||
await userEvent.click(await canvas.findByRole('button'))
|
||||
await userEvent.click(await canvas.findByRole("button"))
|
||||
expect(args.onPress).toHaveBeenCalledTimes(1)
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user