Skip to content

Commit 0d585d4

Browse files
committed
test: add test for url label
1 parent 27aaa61 commit 0d585d4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

__test__/itembuilder.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@ describe("Test ItemBuilder", () => {
6161
expect(primaryUrls).toEqual(1);
6262
});
6363

64+
test("url with label", () => {
65+
const newItem = new ItemBuilder()
66+
.setCategory(CategoryEnum.Login)
67+
.addUrl({ label: "1Password", href: "1password.com", primary: true })
68+
.build();
69+
70+
const { urls } = newItem;
71+
expect(urls?.[0].label).toEqual("1Password");
72+
});
73+
6474
test("toggle item.favorite attribute", () => {
6575
// Never called => undefined
6676
const itemNotFavorite = new ItemBuilder()

0 commit comments

Comments
 (0)