Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d643e00

Browse files
committed
fix test
1 parent dc24263 commit d643e00

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

site/src/pages/TemplateVersionEditorPage/ProvisionerTagsPopover.test.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe("ProvisionerTagsPopover", () => {
3131
await userEvent.click(btn);
3232

3333
// Check for existing tags
34-
const el = await screen.findByText(/scope: organization/i);
34+
const el = await screen.findByText(/scope/i);
3535
expect(el).toBeInTheDocument();
3636

3737
// Add key and value
@@ -62,8 +62,10 @@ describe("ProvisionerTagsPopover", () => {
6262
);
6363

6464
// Check for new tag
65-
const el4 = await screen.findByText(/foo: bar/i);
66-
expect(el4).toBeInTheDocument();
65+
const fooTag = await screen.findByText(/foo/i);
66+
expect(fooTag).toBeInTheDocument();
67+
const barValue = await screen.findByText(/bar/i);
68+
expect(barValue).toBeInTheDocument();
6769
});
6870
it("can remove a tag", async () => {
6971
const onSubmit = jest.fn().mockImplementation(({ key, value }) => {
@@ -87,7 +89,7 @@ describe("ProvisionerTagsPopover", () => {
8789
await userEvent.click(btn);
8890

8991
// Check for existing tags
90-
const el = await screen.findByText(/wowzers: whatatag/i);
92+
const el = await screen.findByText(/wowzers/i);
9193
expect(el).toBeInTheDocument();
9294

9395
// Find Delete button
@@ -110,7 +112,7 @@ describe("ProvisionerTagsPopover", () => {
110112
);
111113

112114
// Expect deleted tag to be gone
113-
const el2 = screen.queryByText(/wowzers: whatatag/i);
115+
const el2 = screen.queryByText(/wowzers/i);
114116
expect(el2).not.toBeInTheDocument();
115117
});
116118
});

0 commit comments

Comments
 (0)