Skip to content

Commit d6b8fe7

Browse files
committed
Fix test
1 parent bcaee94 commit d6b8fe7

1 file changed

Lines changed: 25 additions & 20 deletions

File tree

__tests__/html2/transcript/legacyActivityMiddleware.reactionButtons.html

Lines changed: 25 additions & 20 deletions
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/activityGrouping.css" rel="stylesheet" type="text/css" />
@@ -44,7 +44,7 @@
4444
}
4545
} = window;
4646

47-
const BotActivityDecorator = ({ activityID, children }) => (
47+
const BotActivityDecorator = ({ activityId, children }) => (
4848
<div className="bot-activity-decorator">
4949
<ul className="bot-activity-decorator__button-bar">
5050
<li>
@@ -58,28 +58,33 @@
5858
</div>
5959
);
6060

61-
const activityMiddleware = () => next => (...args) => {
62-
const [
63-
{
64-
activity,
65-
activity: {
66-
from: { role }
61+
const activityMiddleware =
62+
() =>
63+
next =>
64+
(...args) => {
65+
const [
66+
{
67+
activity,
68+
activity: {
69+
from: { role }
70+
}
6771
}
68-
}
69-
] = args;
72+
] = args;
7073

71-
if (role === 'bot') {
72-
const { id } = activity;
74+
const handler = next(...args);
7375

74-
return (...renderArgs) => (
75-
<BotActivityDecorator key={id} activityID={id}>
76-
{next(...args)(...renderArgs)}
77-
</BotActivityDecorator>
78-
);
79-
}
76+
if (role === 'bot') {
77+
const { id } = activity;
78+
79+
return (...renderArgs) => (
80+
<BotActivityDecorator activityId={id} key={id}>
81+
{handler(...renderArgs)}
82+
</BotActivityDecorator>
83+
);
84+
}
8085

81-
return next(...args);
82-
};
86+
return handler;
87+
};
8388

8489
run(async function () {
8590
const now = Date.now();

0 commit comments

Comments
 (0)