first commit
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
.container {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react'
|
||||
import { expect } from '@storybook/jest'
|
||||
import { within } from '@storybook/testing-library'
|
||||
import { {{ pascalCase name }}Widget } from './{{ kebabCase name }}.widget'
|
||||
|
||||
const meta: Meta<typeof {{ pascalCase name }}Widget> = {
|
||||
title: '{{ pascalCase name }}Widget',
|
||||
component: {{ pascalCase name }}Widget,
|
||||
argTypes: {},
|
||||
}
|
||||
|
||||
export default meta
|
||||
type Story = StoryObj<typeof {{ pascalCase name }}Widget>
|
||||
|
||||
export const Default: Story = {
|
||||
args: {},
|
||||
async play({ canvasElement }) {
|
||||
const canvas = within(canvasElement)
|
||||
const container = canvas.getByTestId('{{ kebabCase name }}-widget')
|
||||
|
||||
expect(container).toBeTruthy()
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import React from 'react'
|
||||
import styles from './{{ kebabCase name }}.module.css'
|
||||
|
||||
export type {{pascalCase name}}WidgetProps = {}
|
||||
|
||||
export function {{pascalCase name}}Widget(props: {{pascalCase name}}WidgetProps) {
|
||||
return <div data-testid="{{ kebabCase name }}-widget" className={styles.container}></div>
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
'use client'
|
||||
|
||||
export * from './{{kebabCase name}}.widget'
|
||||
Reference in New Issue
Block a user