Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Commit

Permalink
fix: eliminate eslint issues in discountCodes.test
Browse files Browse the repository at this point in the history
Signed-off-by: Spencer Norman <[email protected]>
  • Loading branch information
spencern committed Mar 19, 2020
1 parent fb45c86 commit 969504e
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/queries/discountCodes.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,9 @@ test("throws if permission check fails", async () => {
mockContext.validatePermissions.mockImplementation(() => {
throw new ReactionError("access-denied", "Access Denied");
});
await expect(
discountCodes(mockContext, mockContext.shopId)
).rejects.toThrowErrorMatchingSnapshot();
expect(
mockContext.validatePermissions
).toHaveBeenCalledWith(
`reaction:legacy:discounts`,
await expect(discountCodes(mockContext, mockContext.shopId)).rejects.toThrowErrorMatchingSnapshot();
expect(mockContext.validatePermissions).toHaveBeenCalledWith(
"reaction:legacy:discounts",
"read",
{ shopId: mockContext.shopId }
);
Expand All @@ -30,10 +26,8 @@ test("returns Discounts cursor if user has permission", async () => {
mockContext.validatePermissions.mockReturnValueOnce(Promise.resolve(null));
mockContext.collections.Discounts.find.mockReturnValueOnce("CURSOR");
const result = await discountCodes(mockContext, mockContext.shopId);
expect(
mockContext.validatePermissions
).toHaveBeenCalledWith(
`reaction:legacy:discounts`,
expect(mockContext.validatePermissions).toHaveBeenCalledWith(
"reaction:legacy:discounts",
"read",
{ shopId: mockContext.shopId }
);
Expand Down

0 comments on commit 969504e

Please sign in to comment.