Serach codeIdAttr in first message event
This commit is contained in:
parent
5ac758c6ba
commit
6083c3f7ea
@ -193,7 +193,9 @@ describe("RestClient", () => {
|
||||
// console.log("Raw log:", result.raw_log);
|
||||
expect(result.code).toBeFalsy();
|
||||
const [firstLog] = parseSuccess(result.raw_log);
|
||||
const codeIdAttr = firstLog.events[0].attributes.find(attr => attr.key === "code_id");
|
||||
const codeIdAttr = firstLog.events
|
||||
.find(event => event.type === "message")
|
||||
?.attributes.find(attr => attr.key === "code_id");
|
||||
if (!codeIdAttr) throw new Error("Could not find code_id attribute");
|
||||
codeId = Number.parseInt(codeIdAttr.value, 10);
|
||||
expect(codeId).toBeGreaterThanOrEqual(1);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user