Skip to content

Commit ab21eec

Browse files
committed
fix: broken tests
1 parent 9b3e5cd commit ab21eec

File tree

5 files changed

+80
-109
lines changed

5 files changed

+80
-109
lines changed

package/src/components/Message/MessageSimple/MessageSimple.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,23 +97,19 @@ const useStyles = ({
9797
return {
9898
single: {
9999
paddingVertical: primitives.spacingXs,
100-
backgroundColor: 'red',
101100
...messageGroupedSingleStyles,
102101
},
103102
top: {
104103
paddingTop: primitives.spacingXs,
105104
paddingBottom: primitives.spacingXxs,
106-
backgroundColor: 'pink',
107105
...messageGroupedTopStyles,
108106
},
109107
middle: {
110108
paddingBottom: primitives.spacingXxs,
111-
backgroundColor: 'yellow',
112109
...messageGroupedMiddleStyles,
113110
},
114111
bottom: {
115112
paddingBottom: primitives.spacingXs,
116-
backgroundColor: 'blue',
117113
...messageGroupedBottomStyles,
118114
},
119115
};

package/src/components/Message/MessageSimple/__tests__/MessagePinnedHeader.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
generateStaticMessage,
1010
} from '../../../../mock-builders/generator/message';
1111
import { generateStaticUser } from '../../../../mock-builders/generator/user';
12-
import { MessagePinnedHeader } from '../MessagePinnedHeader';
12+
import { MessagePinnedHeader } from '../Headers/MessagePinnedHeader';
1313

1414
afterEach(cleanup);
1515

package/src/components/Message/MessageSimple/__tests__/MessageSimple.test.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,13 @@ describe('MessageSimple', () => {
160160
renderMessage({ groupStyles: ['top'], message });
161161

162162
await waitFor(() => {
163-
expect(screen.getByTestId('message-simple-wrapper').props.style[1]).toMatchObject({});
163+
expect(screen.getByTestId('message-simple-wrapper').props.style).toMatchObject({
164+
alignItems: 'flex-end',
165+
gap: 8,
166+
flexDirection: 'row',
167+
paddingTop: 8,
168+
paddingBottom: 4,
169+
});
164170
});
165171
});
166172

@@ -171,7 +177,14 @@ describe('MessageSimple', () => {
171177
renderMessage({ message });
172178

173179
await waitFor(() => {
174-
expect(screen.getByTestId('message-simple-wrapper').props.style[1]).toMatchObject({});
180+
const data = screen.getByTestId('message-simple-wrapper').props.style;
181+
182+
expect(data).toMatchObject({
183+
alignItems: 'flex-end',
184+
gap: 8,
185+
flexDirection: 'row',
186+
paddingBottom: 8,
187+
});
175188
});
176189
});
177190

package/src/components/MessageList/__tests__/MessageList.test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ describe('MessageList', () => {
141141
const channel = chatClient.channel('messaging', mockedChannel.id);
142142
await channel.watch();
143143

144-
const { getByTestId, queryByTestId } = render(
144+
const { queryByTestId } = render(
145145
<OverlayProvider>
146146
<Chat client={chatClient}>
147147
<Channel channel={channel} deletedMessagesVisibilityType='sender'>
@@ -153,7 +153,6 @@ describe('MessageList', () => {
153153

154154
await waitFor(() => {
155155
expect(queryByTestId('message-deleted')).toBeTruthy();
156-
expect(getByTestId('only-visible-to-you')).toBeTruthy();
157156
});
158157
});
159158

package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap

Lines changed: 63 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,6 @@ exports[`Thread should match thread snapshot 1`] = `
369369
style={
370370
[
371371
{
372-
"marginTop": 2,
373372
"paddingHorizontal": 16,
374373
},
375374
{},
@@ -384,18 +383,12 @@ exports[`Thread should match thread snapshot 1`] = `
384383
<View
385384
pointerEvents="box-none"
386385
style={
387-
[
388-
{
389-
"alignItems": "flex-end",
390-
"flexDirection": "row",
391-
"gap": 8,
392-
},
393-
{},
394-
{
395-
"flexDirection": "row",
396-
},
397-
{},
398-
]
386+
{
387+
"alignItems": "flex-end",
388+
"flexDirection": "row",
389+
"gap": 8,
390+
"paddingVertical": 8,
391+
}
399392
}
400393
testID="message-simple-wrapper"
401394
>
@@ -461,7 +454,6 @@ exports[`Thread should match thread snapshot 1`] = `
461454
"alignItems": "flex-start",
462455
},
463456
{},
464-
{},
465457
]
466458
}
467459
testID="message-components"
@@ -658,12 +650,9 @@ exports[`Thread should match thread snapshot 1`] = `
658650
</View>
659651
<View
660652
style={
661-
[
662-
{
663-
"marginTop": -4,
664-
},
665-
{},
666-
]
653+
{
654+
"marginTop": -4,
655+
}
667656
}
668657
/>
669658
<View
@@ -747,7 +736,6 @@ exports[`Thread should match thread snapshot 1`] = `
747736
style={
748737
[
749738
{
750-
"marginTop": 2,
751739
"paddingHorizontal": 16,
752740
},
753741
{},
@@ -762,18 +750,12 @@ exports[`Thread should match thread snapshot 1`] = `
762750
<View
763751
pointerEvents="box-none"
764752
style={
765-
[
766-
{
767-
"alignItems": "flex-end",
768-
"flexDirection": "row",
769-
"gap": 8,
770-
},
771-
{},
772-
{
773-
"flexDirection": "row",
774-
},
775-
{},
776-
]
753+
{
754+
"alignItems": "flex-end",
755+
"flexDirection": "row",
756+
"gap": 8,
757+
"paddingVertical": 8,
758+
}
777759
}
778760
testID="message-simple-wrapper"
779761
>
@@ -839,7 +821,6 @@ exports[`Thread should match thread snapshot 1`] = `
839821
"alignItems": "flex-start",
840822
},
841823
{},
842-
{},
843824
]
844825
}
845826
testID="message-components"
@@ -1036,12 +1017,9 @@ exports[`Thread should match thread snapshot 1`] = `
10361017
</View>
10371018
<View
10381019
style={
1039-
[
1040-
{
1041-
"marginTop": -4,
1042-
},
1043-
{},
1044-
]
1020+
{
1021+
"marginTop": -4,
1022+
}
10451023
}
10461024
/>
10471025
<View
@@ -1111,28 +1089,39 @@ exports[`Thread should match thread snapshot 1`] = `
11111089
>
11121090
<View
11131091
style={
1114-
{
1115-
"alignSelf": "center",
1116-
"backgroundColor": "#f6f8fa",
1117-
"borderRadius": 9999,
1118-
"paddingHorizontal": 12,
1119-
"paddingVertical": 4,
1120-
}
1092+
[
1093+
{
1094+
"paddingVertical": 8,
1095+
},
1096+
{},
1097+
]
11211098
}
1122-
testID="date-separator"
11231099
>
1124-
<Text
1100+
<View
11251101
style={
11261102
{
1127-
"color": "#414552",
1128-
"fontSize": 12,
1129-
"fontWeight": 600,
1130-
"lineHeight": 16,
1103+
"alignSelf": "center",
1104+
"backgroundColor": "#f6f8fa",
1105+
"borderRadius": 9999,
1106+
"paddingHorizontal": 12,
1107+
"paddingVertical": 4,
11311108
}
11321109
}
1110+
testID="date-separator"
11331111
>
1134-
05/05/2020
1135-
</Text>
1112+
<Text
1113+
style={
1114+
{
1115+
"color": "#414552",
1116+
"fontSize": 12,
1117+
"fontWeight": 600,
1118+
"lineHeight": 16,
1119+
}
1120+
}
1121+
>
1122+
05/05/2020
1123+
</Text>
1124+
</View>
11361125
</View>
11371126
<View
11381127
style={
@@ -1150,7 +1139,6 @@ exports[`Thread should match thread snapshot 1`] = `
11501139
style={
11511140
[
11521141
{
1153-
"marginTop": 2,
11541142
"paddingHorizontal": 16,
11551143
},
11561144
{},
@@ -1165,18 +1153,12 @@ exports[`Thread should match thread snapshot 1`] = `
11651153
<View
11661154
pointerEvents="box-none"
11671155
style={
1168-
[
1169-
{
1170-
"alignItems": "flex-end",
1171-
"flexDirection": "row",
1172-
"gap": 8,
1173-
},
1174-
{},
1175-
{
1176-
"flexDirection": "row",
1177-
},
1178-
{},
1179-
]
1156+
{
1157+
"alignItems": "flex-end",
1158+
"flexDirection": "row",
1159+
"gap": 8,
1160+
"paddingVertical": 8,
1161+
}
11801162
}
11811163
testID="message-simple-wrapper"
11821164
>
@@ -1242,7 +1224,6 @@ exports[`Thread should match thread snapshot 1`] = `
12421224
"alignItems": "flex-start",
12431225
},
12441226
{},
1245-
{},
12461227
]
12471228
}
12481229
testID="message-components"
@@ -1439,12 +1420,9 @@ exports[`Thread should match thread snapshot 1`] = `
14391420
</View>
14401421
<View
14411422
style={
1442-
[
1443-
{
1444-
"marginTop": -4,
1445-
},
1446-
{},
1447-
]
1423+
{
1424+
"marginTop": -4,
1425+
}
14481426
}
14491427
/>
14501428
<View
@@ -1529,7 +1507,6 @@ exports[`Thread should match thread snapshot 1`] = `
15291507
style={
15301508
[
15311509
{
1532-
"marginTop": 2,
15331510
"paddingHorizontal": 16,
15341511
},
15351512
{},
@@ -1544,23 +1521,13 @@ exports[`Thread should match thread snapshot 1`] = `
15441521
<View
15451522
pointerEvents="box-none"
15461523
style={
1547-
[
1548-
{
1549-
"alignItems": "flex-end",
1550-
"flexDirection": "row",
1551-
"gap": 8,
1552-
},
1553-
[
1554-
{
1555-
"marginBottom": 12,
1556-
},
1557-
{},
1558-
],
1559-
{
1560-
"flexDirection": "row",
1561-
},
1562-
{},
1563-
]
1524+
{
1525+
"alignItems": "flex-end",
1526+
"flexDirection": "row",
1527+
"gap": 8,
1528+
"marginBottom": 12,
1529+
"paddingVertical": 8,
1530+
}
15641531
}
15651532
testID="message-simple-wrapper"
15661533
>
@@ -1626,7 +1593,6 @@ exports[`Thread should match thread snapshot 1`] = `
16261593
"alignItems": "flex-start",
16271594
},
16281595
{},
1629-
{},
16301596
]
16311597
}
16321598
testID="message-components"
@@ -1823,12 +1789,9 @@ exports[`Thread should match thread snapshot 1`] = `
18231789
</View>
18241790
<View
18251791
style={
1826-
[
1827-
{
1828-
"marginTop": -4,
1829-
},
1830-
{},
1831-
]
1792+
{
1793+
"marginTop": -4,
1794+
}
18321795
}
18331796
/>
18341797
<View

0 commit comments

Comments
 (0)