perf(web): route-level code-splitting; harden channel config rendering
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BwxdSt4reTm7Dj1oxRvpP3
This commit is contained in:
@@ -48,6 +48,16 @@ test("отрисовывает список каналов без секрета
|
||||
expect(screen.queryByDisplayValue(/123456/)).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
test("formatConfig — вайтлист по типу канала не печатает незнакомые поля config", async () => {
|
||||
vi.spyOn(api, "listChannels").mockResolvedValue([
|
||||
{ id: "c5", type: "webhook", config: { url: "https://x", token: "LEAK" }, enabled: true },
|
||||
])
|
||||
renderPage()
|
||||
|
||||
expect(await screen.findByText(/url: https:\/\/x/)).toBeInTheDocument()
|
||||
expect(document.body.textContent).not.toMatch(/LEAK/)
|
||||
})
|
||||
|
||||
test("создание telegram-канала собирает config.chat_id + secret=bot_token", async () => {
|
||||
const createSpy = vi.spyOn(api, "createChannel").mockResolvedValue({
|
||||
id: "c3", type: "telegram", config: { chat_id: "999" }, enabled: true,
|
||||
|
||||
Reference in New Issue
Block a user