@kaizen/components 0.0.0-canary-debug-kaizenprovider-20241223004555 → 0.0.0-canary-debug-kaizen-provider-20241223031700
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaizen/components",
|
|
3
|
-
"version": "0.0.0-canary-debug-
|
|
3
|
+
"version": "0.0.0-canary-debug-kaizen-provider-20241223031700",
|
|
4
4
|
"description": "Kaizen component library",
|
|
5
5
|
"author": "Geoffrey Chong <geoff.chong@cultureamp.com>",
|
|
6
6
|
"homepage": "https://cultureamp.design",
|
|
@@ -117,8 +117,8 @@
|
|
|
117
117
|
"svgo": "^3.3.2",
|
|
118
118
|
"tslib": "^2.8.1",
|
|
119
119
|
"tsx": "^4.19.2",
|
|
120
|
-
"@kaizen/
|
|
121
|
-
"@kaizen/
|
|
120
|
+
"@kaizen/package-bundler": "2.0.3",
|
|
121
|
+
"@kaizen/design-tokens": "10.8.6"
|
|
122
122
|
},
|
|
123
123
|
"devDependenciesComments": {
|
|
124
124
|
"sass": "Prevent deprecation warnings introduced in 1.80 as we plan to move away from sass",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useId } from 'react'
|
|
2
2
|
import { type Meta, type StoryObj } from '@storybook/react'
|
|
3
|
-
import { expect, within } from '@storybook/test'
|
|
3
|
+
import { expect, userEvent, within } from '@storybook/test'
|
|
4
4
|
import { Button } from '~components/Button'
|
|
5
5
|
import { ToastNotification, useToastNotification } from '../index'
|
|
6
6
|
|
|
@@ -175,26 +175,27 @@ export const NoDuplicatesWithSameId: Story = {
|
|
|
175
175
|
render: () => {
|
|
176
176
|
const { addToastNotification } = useToastNotification()
|
|
177
177
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}, [addToastNotification])
|
|
192
|
-
|
|
193
|
-
return <div>Irrelevant content</div>
|
|
178
|
+
return (
|
|
179
|
+
<Button
|
|
180
|
+
label="Create notification"
|
|
181
|
+
onClick={() =>
|
|
182
|
+
addToastNotification({
|
|
183
|
+
id: 'id--clear-example-1',
|
|
184
|
+
title: 'First',
|
|
185
|
+
type: 'positive',
|
|
186
|
+
message: 'There should only be one notification',
|
|
187
|
+
})
|
|
188
|
+
}
|
|
189
|
+
/>
|
|
190
|
+
)
|
|
194
191
|
},
|
|
195
192
|
play: async (context) => {
|
|
196
193
|
const { canvasElement } = context
|
|
197
|
-
const { findAllByText } = within(canvasElement.parentElement!)
|
|
194
|
+
const { findAllByText, findByRole } = within(canvasElement.parentElement!)
|
|
195
|
+
|
|
196
|
+
const createNotificationButton = await findByRole('button', { name: 'Create notification' })
|
|
197
|
+
await userEvent.click(createNotificationButton)
|
|
198
|
+
await userEvent.click(createNotificationButton)
|
|
198
199
|
|
|
199
200
|
const notifications = await findAllByText('There should only be one notification')
|
|
200
201
|
expect(notifications).toHaveLength(1)
|