Skip to content

Commit

Permalink
Add a snapshot for the full message
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Bartholomae <[email protected]>
  • Loading branch information
dbartholomae committed May 14, 2023
1 parent b1b0ad3 commit 2aef6ad
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/action-helper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,42 @@ import { InstanceFixture } from "./models/InstanceFixture";

describe("action-helper", () => {
describe("createMessage", () => {
it("returns the snapshot message", () => {
expect(
createMessage(
[
{
"@name": "http://localhost:8080",
alerts: [
{
name: "Cross Site Scripting (Reflected)",
pluginid: "40012",
riskcode: "2",
confidence: "3",
instances: [
{ uri: "http://localhost:8080/bodgeit/contact.jsp" },
],
},
],
},
],

"2343454356",
"https://github.com/zaproxy/actions-common/actions/runs/4926339347"
)
).toMatchInlineSnapshot(`
"- Site: [http://localhost:8080](http://localhost:8080)
**New Alerts**
- **Medium risk (Confidence: High): Cross Site Scripting (Reflected)** [[40012]](https://www.zaproxy.org/docs/alerts/40012) total: 1:
- [http://localhost:8080/bodgeit/contact.jsp](http://localhost:8080/bodgeit/contact.jsp)
https://github.com/zaproxy/actions-common/actions/runs/4926339347
2343454356"
`);
});

it("returns the count of instances for an alert", () => {
expect(
createMessage(
Expand Down

0 comments on commit 2aef6ad

Please sign in to comment.