1
0
Fork 0
mirror of synced 2024-10-02 10:08:09 +13:00

Improve tests

This commit is contained in:
Adria Navarro 2024-03-13 16:54:39 +01:00
parent 940ff5acd2
commit 625c1dda9f

View file

@ -121,7 +121,21 @@ describe("attachment cleanup", () => {
delete originalTable.schema["attach"]
await AttachmentCleanup.tableUpdate(
originalTable,
[{ attach: undefined }],
[row("file 1"), { attach: undefined }, row("file 2")],
{
oldTable: table(),
}
)
expect(mockedDeleteFiles).toBeCalledTimes(1)
expect(mockedDeleteFiles).toBeCalledWith(BUCKET, ["file 1", "file 2"])
})
it("should be able to cleanup a column and not throw when ALL attachments are undefined", async () => {
const originalTable = table()
delete originalTable.schema["attach"]
await AttachmentCleanup.tableUpdate(
originalTable,
[{}, { attach: undefined }],
{
oldTable: table(),
}