qbo_auth: журнал действий страницы ручных тестов (ручной тест: действие и результат)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -32,7 +32,8 @@ describe("вебхук Intuit", () => {
|
||||
});
|
||||
|
||||
it("страница тестов: только по секретному адресу, заголовки без кэша, заметка принимается", async () => {
|
||||
const app = buildApi({} as QboAuth, "svc");
|
||||
const audit = { info: vi.fn() };
|
||||
const app = buildApi({} as QboAuth, "svc", undefined, undefined, audit);
|
||||
const slug = testsSlug("svc");
|
||||
expect(slug).toMatch(/^[0-9a-f]{32}$/);
|
||||
expect((await app.inject({ url: "/tests/wrong" })).statusCode).toBe(404);
|
||||
@@ -46,6 +47,7 @@ describe("вебхук Intuit", () => {
|
||||
const h = { "content-type": "application/json" };
|
||||
expect((await app.inject({ method: "POST", url: `/tests/${slug}/note`, headers: h, payload: { text: "Bill 12.50" } })).statusCode).toBe(200);
|
||||
expect((await app.inject({ method: "POST", url: `/tests/${slug}/note`, headers: h, payload: { text: " " } })).statusCode).toBe(400);
|
||||
expect(audit.info).toHaveBeenCalledWith({ action: "note", note: "Bill 12.50" }, "ручной тест");
|
||||
});
|
||||
|
||||
it("вебхук с типом application/cloudevents+json принимается (раньше было 415)", async () => {
|
||||
|
||||
Reference in New Issue
Block a user