Skip to content

Commit 8f9953f

Browse files
authored
Fix flaky test src/room/composer/Banner/Banner.stories.tsx > With Avatar Image (#33275)
* Fix flaky test `src/room/composer/Banner/Banner.stories.tsx > With Avatar Image` it was previously loading an external (slow) image which was random (!) by design Fixes #33273 * Fix styling * Iterate * Update snapshot
1 parent 12df09b commit 8f9953f

5 files changed

Lines changed: 9 additions & 7 deletions

File tree

apps/web/test/unit-tests/components/structures/__snapshots__/RoomView-test.tsx.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,12 @@ exports[`RoomView for a local room in state ERROR should match the snapshot 1`]
213213
</div>
214214
<div
215215
aria-labelledby="_r_1c3_"
216-
class="_banner_193k4_8"
216+
class="_banner_n7ud0_8"
217217
data-type="critical"
218218
role="status"
219219
>
220220
<div
221-
class="_icon_193k4_50"
221+
class="_icon_n7ud0_50"
222222
>
223223
<svg
224224
fill="currentColor"
@@ -234,7 +234,7 @@ exports[`RoomView for a local room in state ERROR should match the snapshot 1`]
234234
</svg>
235235
</div>
236236
<div
237-
class="_content_193k4_38"
237+
class="_content_n7ud0_38"
238238
>
239239
<p
240240
class="_typography_6v6n8_153 _font-body-md-medium_6v6n8_60 _title_1xryk_24"
@@ -244,7 +244,7 @@ exports[`RoomView for a local room in state ERROR should match the snapshot 1`]
244244
</p>
245245
</div>
246246
<div
247-
class="_actions_193k4_60"
247+
class="_actions_n7ud0_61"
248248
>
249249
<button
250250
class="_button_13vu4_8 _primaryAction_1xryk_20 _has-icon_13vu4_60"
14.7 KB
Loading

packages/shared-components/src/room/composer/Banner/Banner.module.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,13 @@
4848
}
4949

5050
.icon {
51-
width: 24px;
5251
display: flex;
5352
align-items: flex-start;
5453
}
5554

5655
.icon img {
56+
height: 24px;
57+
aspect-ratio: auto;
5758
border-radius: 50%;
5859
}
5960

packages/shared-components/src/room/composer/Banner/Banner.stories.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { type Meta, type StoryObj } from "@storybook/react-vite";
1111
import { Button } from "@vector-im/compound-web";
1212

1313
import { Banner } from "./Banner";
14+
import avatarImage from "../../../../static/element.png";
1415

1516
const meta = {
1617
title: "room/Banner",
@@ -58,7 +59,7 @@ export const WithAction: Story = {
5859

5960
export const WithAvatarImage: Story = {
6061
args: {
61-
avatar: <img alt="Example" src="https://picsum.photos/32/32" />,
62+
avatar: <img alt="Example" src={avatarImage} />,
6263
},
6364
};
6465

packages/shared-components/src/room/composer/Banner/__snapshots__/Banner.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ exports[`AvatarWithDetails > renders a banner with an avatar iamge 1`] = `
7878
>
7979
<img
8080
alt="Example"
81-
src="https://picsum.photos/32/32"
81+
src="/static/element.png"
8282
/>
8383
</div>
8484
<div

0 commit comments

Comments
 (0)