|
1 | 1 | import React from 'react' |
| 2 | +import { v4 as getUUID } from 'uuid' |
2 | 3 |
|
3 | 4 | import { |
4 | 5 | supportedViewports, |
@@ -89,25 +90,45 @@ describe('ElementRenderer', () => { |
89 | 90 | messages={[ |
90 | 91 | { |
91 | 92 | ...sampleMessage, |
92 | | - data: { text: 'Test' }, |
| 93 | + data: { text: 'This' }, |
93 | 94 | format: 'streamingText', |
94 | 95 | }, |
95 | 96 | { |
96 | | - id: '2', |
| 97 | + id: getUUID(), |
97 | 98 | timestamp: '2020-01-02T00:00:00.000Z', |
98 | 99 | sender: testUser, |
99 | 100 | conversationId: 'lkd9vc', |
100 | 101 | topic: 'default', |
101 | 102 | threadId: '1', |
102 | | - data: { text: ' Text' }, |
| 103 | + data: { text: ' is' }, |
| 104 | + format: 'streamingText', |
| 105 | + }, |
| 106 | + { |
| 107 | + id: getUUID(), |
| 108 | + timestamp: '2020-01-02T00:00:00.000Z', |
| 109 | + sender: testUser, |
| 110 | + conversationId: 'lkd9vc', |
| 111 | + topic: 'default', |
| 112 | + threadId: '1', |
| 113 | + data: { text: ' streaming' }, |
| 114 | + format: 'streamingText', |
| 115 | + }, |
| 116 | + { |
| 117 | + id: getUUID(), |
| 118 | + timestamp: '2020-01-02T00:00:00.000Z', |
| 119 | + sender: testUser, |
| 120 | + conversationId: 'lkd9vc', |
| 121 | + topic: 'default', |
| 122 | + threadId: '1', |
| 123 | + data: { text: ' text.' }, |
103 | 124 | format: 'streamingText', |
104 | 125 | }, |
105 | 126 | ]} |
106 | 127 | {...commonProps} |
107 | 128 | ws={mockWsClient} |
108 | 129 | /> |
109 | 130 | ) |
110 | | - cy.get('p').should('contain.text', 'Test Text') |
| 131 | + cy.get('p').should('contain.text', 'This is streaming text.') |
111 | 132 | }) |
112 | 133 |
|
113 | 134 | it(`renders a message for an unsupported format on ${viewport} screen`, () => { |
|
0 commit comments