feat: link tickets in comments and align admin sidebars
This commit is contained in:
parent
c35eb673d3
commit
b0f57009ac
15 changed files with 1606 additions and 424 deletions
29
tests/change-assignee-comment.test.ts
Normal file
29
tests/change-assignee-comment.test.ts
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import { describe, expect, it } from "vitest"
|
||||
|
||||
import { buildAssigneeChangeComment } from "../convex/tickets"
|
||||
|
||||
describe("buildAssigneeChangeComment", () => {
|
||||
it("inclui nomes antigos e novos e quebra o motivo em parágrafos", () => {
|
||||
const html = buildAssigneeChangeComment("Transferir para o time B\nCliente solicitou gestor.", {
|
||||
previousName: "Ana",
|
||||
nextName: "Bruno",
|
||||
})
|
||||
|
||||
expect(html).toContain("Ana")
|
||||
expect(html).toContain("Bruno")
|
||||
expect(html).toContain("<p>Transferir para o time B</p>")
|
||||
expect(html).toContain("<p>Cliente solicitou gestor.</p>")
|
||||
})
|
||||
|
||||
it("escapa caracteres perigosos", () => {
|
||||
const html = buildAssigneeChangeComment("<script>alert(1)</script>", {
|
||||
previousName: "<Ana>",
|
||||
nextName: "Bruno & Co",
|
||||
})
|
||||
|
||||
expect(html).toContain("<Ana>")
|
||||
expect(html).toContain("Bruno & Co")
|
||||
expect(html).not.toContain("<script>")
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue