@kindly/react-chat 2.39.2 → 2.39.4

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": "@kindly/react-chat",
3
- "version": "2.39.2",
3
+ "version": "2.39.4",
4
4
  "description": "Kindly Chat react component",
5
5
  "repository": "https://github.com/kindly-ai/kindly-chat/tree/main/packages/react-chat",
6
6
  "main": "dist/index.js",
@@ -126,5 +126,5 @@
126
126
  "silent": true,
127
127
  "webpackConfig": "./webpack.config.js"
128
128
  },
129
- "gitHead": "db6fb43b558e667bb6c3124f3e0447bb403592d1"
129
+ "gitHead": "d7deb45ab7212650f94d159204e63e1d869ec161"
130
130
  }
@@ -1,6 +1,7 @@
1
+ import { expect } from '@storybook/jest';
1
2
  /* eslint-disable react-hooks/exhaustive-deps */
2
3
  /* eslint-disable react/prop-types */
3
- import { screen, userEvent } from '@storybook/testing-library';
4
+ import { fireEvent, screen, userEvent, waitFor } from '@storybook/testing-library';
4
5
  import React from 'react';
5
6
  import withFetchMock from 'storybook-addon-mock';
6
7
 
@@ -268,6 +269,22 @@ MultilineBotMessage.parameters = {
268
269
  },
269
270
  },
270
271
  };
272
+ MultilineBotMessage.play = async () => {
273
+ const chatBody = await screen.findByTestId('chat-body-container');
274
+ await screen.findAllByText('Single-line lonely message');
275
+ // wait for the auto-scroll to execute
276
+ await new Promise((resolve) => {
277
+ setTimeout(resolve, 10);
278
+ });
279
+ fireEvent.scroll(chatBody, { target: { scrollTop: 0 } });
280
+ const chatNewMessage = await screen.findByTestId('chat-new-message');
281
+ await waitFor(
282
+ async () => {
283
+ await expect(chatNewMessage).toBeVisible();
284
+ },
285
+ { timeout: 5000 },
286
+ );
287
+ };
271
288
 
272
289
  export const GroupsOfMessages = Template.bind({});
273
290
  GroupsOfMessages.parameters = {