Last active
April 4, 2021 11:55
-
-
Save goldbergyoni/49cf85898432b79058838b67a92d793a to your computer and use it in GitHub Desktop.
Delete white-box
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test("When deleting an existing order, Then the DB should have 0 records", async () => { | |
| // Arrange | |
| const orderToAdd = { | |
| userId: 1, | |
| productId: 2, | |
| invoiceId: `123`, //unique field | |
| }; | |
| await request(expressApp).post("/order").send(orderToAdd); | |
| // Act | |
| const receivedResponse = await request(expressApp).delete(`/order/${existingOrderId}`); | |
| // Assert | |
| const numberOfOrders = await Orders.count; | |
| expect(numberOfOrders).toBe(0); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment