Skip to content

Commit dca0089

Browse files
committed
fix: fix tests and utils
1 parent 961cd2c commit dca0089

File tree

9 files changed

+16
-20
lines changed

9 files changed

+16
-20
lines changed

dist/functions/deleteItems/test.js

Lines changed: 2 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/functions/deleteItems/test.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/functions/getItems/subtests/runPaginationTests.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/functions/getItems/subtests/runPaginationTests.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/functions/replaceItem/test.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/functions/replaceItem/test.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/functions/DeleteItems/test.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import ItemNotFoundError from "../../errors/ItemNotFoundError";
22
import Facade from "../../Facade";
33
import { Filter, Options } from "../../interfaces";
4-
import { secondItem, secondItemId, TestItem } from "../utils/testItem";
4+
import { secondItem, secondItemId, TestItem, firstItem } from "../utils/testItem";
55
import testUsingFilter from "../utils/testUsingFilter";
66

77
interface ExpectDeleteItemsOptions<T extends TestItem> {
@@ -17,9 +17,7 @@ const expectDeleteItems = async ({
1717
}: ExpectDeleteItemsOptions<TestItem>) => {
1818
await facade.deleteItems({ filter });
1919

20-
const { items } = await facade.getItems({
21-
filter
22-
});
20+
const { items } = await facade.getItems({});
2321

2422
expect(items).toEqual(expectedValue);
2523
};
@@ -44,7 +42,7 @@ export default ({ facade }: Options<TestItem>) => {
4442
},
4543
toGetNoItems: async filter => {
4644
await expectDeleteItems({
47-
expectedValue: [],
45+
expectedValue: [firstItem, secondItem],
4846
facade,
4947
filter
5048
});

src/functions/GetItems/subtests/runPaginationTests.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ export default ({ facade }: Options<TestItem>) => {
8080
});
8181
});
8282

83-
it("should return second entity when after is firstCursor", async() => {
83+
it("should return second item when after is firstCursor", async() => {
8484
await expectCorrectResult({
85-
after: start,
85+
after: firstCursor,
8686
expectedCursor: {
8787
after: secondCursor,
8888
before: secondCursor,
@@ -108,7 +108,7 @@ export default ({ facade }: Options<TestItem>) => {
108108
});
109109
});
110110

111-
it("should return no entities when before is firstCursor", async() => {
111+
it("should return no items when before is firstCursor", async() => {
112112
await expectCorrectResult({
113113
before: firstCursor,
114114
expectedCursor: {

src/functions/ReplaceItem/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const expectReplaceItem = async ({
2626
const result = await facade.replaceItem({
2727
filter,
2828
id,
29-
item
29+
item: replacement
3030
});
3131
expect(result.item).toEqual(replacement);
3232
};

0 commit comments

Comments
 (0)