Skip to content

Commit 2aef6ad

Browse files
committed
Add a snapshot for the full message
Signed-off-by: Daniel Bartholomae <[email protected]>
1 parent b1b0ad3 commit 2aef6ad

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

src/action-helper.test.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,42 @@ import { InstanceFixture } from "./models/InstanceFixture";
55

66
describe("action-helper", () => {
77
describe("createMessage", () => {
8+
it("returns the snapshot message", () => {
9+
expect(
10+
createMessage(
11+
[
12+
{
13+
"@name": "http://localhost:8080",
14+
alerts: [
15+
{
16+
name: "Cross Site Scripting (Reflected)",
17+
pluginid: "40012",
18+
riskcode: "2",
19+
confidence: "3",
20+
instances: [
21+
{ uri: "http://localhost:8080/bodgeit/contact.jsp" },
22+
],
23+
},
24+
],
25+
},
26+
],
27+
28+
"2343454356",
29+
"https://github.com/zaproxy/actions-common/actions/runs/4926339347"
30+
)
31+
).toMatchInlineSnapshot(`
32+
"- Site: [http://localhost:8080](http://localhost:8080)
33+
**New Alerts**
34+
- **Medium risk (Confidence: High): Cross Site Scripting (Reflected)** [[40012]](https://www.zaproxy.org/docs/alerts/40012) total: 1:
35+
- [http://localhost:8080/bodgeit/contact.jsp](http://localhost:8080/bodgeit/contact.jsp)
36+
37+
38+
39+
https://github.com/zaproxy/actions-common/actions/runs/4926339347
40+
2343454356"
41+
`);
42+
});
43+
844
it("returns the count of instances for an alert", () => {
945
expect(
1046
createMessage(

0 commit comments

Comments
 (0)