Skip to content

Commit 64ca8a2

Browse files
committed
Add expectation
1 parent 2e03849 commit 64ca8a2

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

__tests__/html/timestamp.changeGrouping.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en-US">
33
<head>
44
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
@@ -35,18 +35,30 @@
3535
await pageConditions.minNumActivitiesShown(3);
3636

3737
// THEN: There should be 3 activities in total: 1 from user, followed by 2 from the bot.
38+
expect(
39+
pageElements.activityStatuses().map(element => element.querySelector('[aria-hidden="true"]')?.textContent)
40+
).toEqual(['Just now', undefined, 'Just now']);
41+
3842
await host.snapshot();
3943

4044
// WHEN: `styleOptions.groupTimestamp` is set to 0, which means, every activity is on its own group.
4145
renderWebChat({ styleOptions: { groupTimestamp: 0 } });
4246

4347
// THEN: Every messages should have timestamp on its own.
48+
expect(
49+
pageElements.activityStatuses().map(element => element.querySelector('[aria-hidden="true"]')?.textContent)
50+
).toEqual(['Just now', 'Just now', 'Just now']);
51+
4452
await host.snapshot();
4553

4654
// WHEN: `styleOptions.groupTimestamp` is set to false, which means, timestamp is disabled.
4755
renderWebChat({ styleOptions: { groupTimestamp: false } });
4856

4957
// THEN: No messages should have timestamp on it.
58+
expect(
59+
pageElements.activityStatuses().map(element => element.querySelector('[aria-hidden="true"]')?.textContent)
60+
).toEqual([undefined, undefined, undefined]);
61+
5062
await host.snapshot();
5163
});
5264
</script>

0 commit comments

Comments
 (0)