-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
809 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
packages/blade/src/components/ChatBubble/__tests__/ChatBubble.ssr.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// test case for ChatBubble component | ||
import { ChatBubble } from '../ChatBubble'; | ||
import renderWithSSR from '~utils/testing/renderWithSSR.web'; | ||
import { RayIcon } from '~components/Icons'; | ||
import { Card, CardBody } from '~components/Card'; | ||
import { Box } from '~components/Box'; | ||
import { Text } from '~components/Typography'; | ||
import { Radio, RadioGroup } from '~components/Radio'; | ||
|
||
describe('<ChatBubble/>', () => { | ||
it('should render last message correctly', () => { | ||
const { container } = renderWithSSR( | ||
<ChatBubble senderType="self" messageType="last"> | ||
{' '} | ||
This is a demo message{' '} | ||
</ChatBubble>, | ||
); | ||
expect(container).toMatchSnapshot(); | ||
}); | ||
it('should render last message correctly', () => { | ||
const { container } = renderWithSSR( | ||
<ChatBubble messageType="default" senderType="self"> | ||
{' '} | ||
This is another demo message{' '} | ||
</ChatBubble>, | ||
); | ||
expect(container).toMatchSnapshot(); | ||
}); | ||
it('should render last message correctly', () => { | ||
const { container } = renderWithSSR( | ||
<ChatBubble | ||
senderType="other" | ||
leading={<RayIcon size="xlarge" color="surface.icon.onSea.onSubtle" />} | ||
> | ||
{' '} | ||
This is another demo message{' '} | ||
</ChatBubble>, | ||
); | ||
expect(container).toMatchSnapshot(); | ||
}); | ||
it('should render last message correctly', () => { | ||
const { container } = renderWithSSR( | ||
<ChatBubble | ||
senderType="other" | ||
leading={<RayIcon size="xlarge" color="surface.icon.onSea.onSubtle" />} | ||
loadingText="Analyzing your response..." | ||
> | ||
<Card> | ||
<CardBody> | ||
<Box display="flex" gap="8px" flexDirection="column"> | ||
<Text variant="body" size="medium"> | ||
Where do you want to collect payments? | ||
</Text> | ||
<RadioGroup> | ||
<Radio value="website">Website</Radio> | ||
<Radio value="android">Android App</Radio> | ||
<Radio value="ios">iOS App</Radio> | ||
</RadioGroup> | ||
</Box> | ||
</CardBody> | ||
</Card> | ||
</ChatBubble>, | ||
); | ||
expect(container).toMatchSnapshot(); | ||
}); | ||
}); |
Oops, something went wrong.