Skip to content

Commit

Permalink
added unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
sunghyunkang1111 committed Sep 18, 2024
1 parent 8781499 commit e0ad523
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Utils/QueryUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,5 +189,18 @@ describe("Query Utils", () => {
);
expect(partitionKeyValues.length).toBe(0);
});

it("should extract all partition key values for hierarchical and nested partition keys", () => {
const mixedPartitionKeyDefinition: PartitionKeyDefinition = {
kind: PartitionKeyKind.MultiHash,
paths: ["/Country", "/Location/type"],
};
const partitionKeyValues: PartitionKey[] = extractPartitionKeyValues(
documentContent,
mixedPartitionKeyDefinition,
);
expect(partitionKeyValues.length).toBe(2);
expect(partitionKeyValues).toEqual(["United States", "Point"]);
});
});
});

0 comments on commit e0ad523

Please sign in to comment.