Skip to content

Commit

Permalink
fix: Fix test to make it less random
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrebouthinon committed Dec 15, 2023
1 parent 612b5f5 commit 4124587
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 20 deletions.
29 changes: 20 additions & 9 deletions tests/scenarios/sendgrid.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,26 @@ describe("Sendgrid", () => {
action: "listAccounts",
});

expect(response.result).toMatchObject({
accounts: [
{ name: "common", options: { defaultSender: "amaret@kuzzle.io" } },
{ name: "ilayda", options: { defaultSender: "ilayda@gmail.com" } },
{
name: "water-fairy",
options: { defaultSender: "water-fairy@gmail.com" },
},
],
expect(response.result.accounts).toHaveLength(5);
expect(response.result.accounts).toContainEqual({
name: "common",
options: { defaultSender: "amaret@kuzzle.io" },
});
expect(response.result.accounts).toContainEqual({
name: "ilayda",
options: { defaultSender: "ilayda@gmail.com" },
});
expect(response.result.accounts).toContainEqual({
name: "water-fairy",
options: { defaultSender: "water-fairy@gmail.com" },
});
expect(response.result.accounts).toContainEqual({
name: "starttls",
options: { defaultSender: "amaret@kuzzle.io" },
});
expect(response.result.accounts).toContainEqual({
name: "tls",
options: { defaultSender: "amaret@kuzzle.io" },
});

await node1.query({
Expand Down
31 changes: 20 additions & 11 deletions tests/scenarios/smtp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,17 +226,26 @@ describe("SMTP", () => {
action: "listAccounts",
});

expect(response.result).toMatchObject({
accounts: [
{ name: "common", options: { defaultSender: "amaret@kuzzle.io" } },
{ name: "starttls", options: { defaultSender: "amaret@kuzzle.io" } },
{ name: "tls", options: { defaultSender: "amaret@kuzzle.io" } },
{ name: "ilayda", options: { defaultSender: "ilayda@gmail.com" } },
{
name: "water-fairy",
options: { defaultSender: "water-fairy@gmail.com" },
},
],
expect(response.result.accounts).toHaveLength(5);
expect(response.result.accounts).toContainEqual({
name: "common",
options: { defaultSender: "amaret@kuzzle.io" },
});
expect(response.result.accounts).toContainEqual({
name: "ilayda",
options: { defaultSender: "ilayda@gmail.com" },
});
expect(response.result.accounts).toContainEqual({
name: "water-fairy",
options: { defaultSender: "water-fairy@gmail.com" },
});
expect(response.result.accounts).toContainEqual({
name: "starttls",
options: { defaultSender: "amaret@kuzzle.io" },
});
expect(response.result.accounts).toContainEqual({
name: "tls",
options: { defaultSender: "amaret@kuzzle.io" },
});

await node1.query({
Expand Down

0 comments on commit 4124587

Please sign in to comment.