-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ryan Lerch <rlerch@redhat.com>
- Loading branch information
Showing
2 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// SPDX-FileCopyrightText: Contributors to the Fedora Project | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
import { cleanup } from "@testing-library/vue"; | ||
import { afterEach, describe, expect, it, vi } from "vitest"; | ||
import DestinationTag from "./DestinationTag.vue"; | ||
import { render } from "./test-utils"; | ||
import type { Destination } from "@/api/types"; | ||
|
||
vi.mock("../auth"); | ||
|
||
describe("DestinationTag", () => { | ||
afterEach(() => { | ||
cleanup(); | ||
}); | ||
|
||
it("check we show the text when icononly is false", () => { | ||
const dest: Destination = { | ||
protocol: "irc", | ||
address: "freednode.net", | ||
}; | ||
const props = { destination: dest, icononly: false }; | ||
const { getByText } = render(DestinationTag, props); | ||
expect(getByText("freednode.net")).toBeInTheDocument(); | ||
expect(getByText("irc:")).toBeInTheDocument(); | ||
}); | ||
it("check we show the text when icononly is true", () => { | ||
const dest: Destination = { | ||
protocol: "irc", | ||
address: "freednode.net", | ||
}; | ||
const props = { destination: dest, icononly: true }; | ||
const { queryByText } = render(DestinationTag, props); | ||
expect(queryByText("freednode.net")).toBeNull(); | ||
expect(queryByText("irc:")).toBeNull(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters