Skip to content

Commit 8f15ee2

Browse files
committed
test: filter entity with default
1 parent 19f2233 commit 8f15ee2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/utils/filter.tests.ts

+7
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ describe("entity filter", () => {
4040
expect(filtered).to.have.deep.members(expected);
4141
});
4242

43+
it("should place the default entity as first element in list", () => {
44+
const filterObjects = [{ path: "/root/entity/b" }, { path: "/root/entity/c", isDefault: true }];
45+
const filtered = filterEntityList({ filterObjects, entitiesOrPaths: entities });
46+
const expectedPath ="/root/entity/c";
47+
expect(filtered[0].path).to.be.equal(expectedPath);
48+
});
49+
4350
it("should filter an entity list containing concatenated paths", () => {
4451
const filterObjects = [{ path: "/root/entity/b" }, { path: "/root/entity/c" }];
4552
const multiPathEntities = [

0 commit comments

Comments
 (0)