mirror of
https://github.com/outline/outline.git
synced 2026-03-03 10:20:23 -06:00
Improve buildAttachment construction in tests
This commit is contained in:
@@ -18,13 +18,13 @@ describe("user model", () => {
|
||||
buildUser({
|
||||
name: "www.google.com",
|
||||
})
|
||||
).rejects.toThrowError();
|
||||
).rejects.toThrow();
|
||||
|
||||
await expect(
|
||||
buildUser({
|
||||
name: "My name https://malicious.com",
|
||||
})
|
||||
).rejects.toThrowError();
|
||||
).rejects.toThrow();
|
||||
|
||||
await expect(
|
||||
buildUser({
|
||||
|
||||
@@ -495,10 +495,12 @@ export async function buildAttachment(
|
||||
const acl = overrides.acl || "public-read";
|
||||
const name = fileName || faker.system.fileName();
|
||||
return Attachment.create({
|
||||
id,
|
||||
key: AttachmentHelper.getKey({ acl, id, name, userId: overrides.userId }),
|
||||
contentType: "image/png",
|
||||
size: 100,
|
||||
acl,
|
||||
name,
|
||||
createdAt: new Date("2018-01-02T00:00:00.000Z"),
|
||||
updatedAt: new Date("2018-01-02T00:00:00.000Z"),
|
||||
...overrides,
|
||||
|
||||
Reference in New Issue
Block a user