feat(medusa): Get route for admin product categories API (#2961)

This commit is contained in:
Riqwan Thamir
2023-01-10 10:08:16 +01:00
committed by GitHub
parent 33b3e5f16d
commit 47d075351f
13 changed files with 393 additions and 2 deletions
@@ -5,6 +5,7 @@ class MockRepo {
remove,
softRemove,
find,
findDescendantsTree,
findOne,
findOneWithRelations,
findOneOrFail,
@@ -18,6 +19,7 @@ class MockRepo {
this.delete_ = del;
this.softRemove_ = softRemove;
this.find_ = find;
this.findDescendantsTree_ = findDescendantsTree;
this.findOne_ = findOne;
this.findOneOrFail_ = findOneOrFail;
this.save_ = save;
@@ -67,6 +69,11 @@ class MockRepo {
return this.findOne_(...args);
}
});
findDescendantsTree = jest.fn().mockImplementation((...args) => {
if (this.findDescendantsTree_) {
return this.findDescendantsTree_(...args);
}
});
findOneOrFail = jest.fn().mockImplementation((...args) => {
if (this.findOneOrFail_) {
return this.findOneOrFail_(...args);