-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
776c1d6
commit d1a4d62
Showing
2 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
.../react/SettingsSidebar/components/IssueSource/components/JqlTextArea/JqlTextArea.test.tsx
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,28 @@ | ||
import React from "react"; | ||
|
||
import { render, screen } from "@testing-library/react"; | ||
import { vi } from "vitest"; | ||
|
||
import JQLTextArea from "./JqlTextArea"; | ||
|
||
describe("<JQLTextArea />", () => { | ||
it("renders without crashing", () => { | ||
render( | ||
<JQLTextArea | ||
jql="issueType in (Epic, Story) order by Rank" | ||
setJql={vi.fn()} | ||
isLoading | ||
isSuccess={false} | ||
totalChunks={10} | ||
receivedChunks={5} | ||
numberOfIssues={10} | ||
/> | ||
); | ||
|
||
const jqlTextarea = screen.getByLabelText("Add your JQL"); | ||
expect(jqlTextarea).toBeInTheDocument(); | ||
|
||
const issuesLoadedText = screen.getByText("Loaded 5 of 10 issues"); | ||
expect(issuesLoadedText).toBeInTheDocument(); | ||
}); | ||
}); |
47 changes: 47 additions & 0 deletions
47
...eact/SettingsSidebar/components/IssueSource/components/LoadChildren/LoadChildren.test.tsx
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,47 @@ | ||
import React from "react"; | ||
|
||
import { render, screen } from "@testing-library/react"; | ||
import { vi } from "vitest"; | ||
|
||
import LoadChildren from "./LoadChildren"; | ||
|
||
describe("<LoadChildren />", () => { | ||
it("renders without crashing", () => { | ||
render( | ||
<LoadChildren | ||
loadChildren={false} | ||
setLoadChildren={vi.fn()} | ||
childJql="" | ||
setChildJql={vi.fn()} | ||
/> | ||
); | ||
|
||
const accordionTitle = screen.getByText(/load children/i); | ||
expect(accordionTitle).toBeInTheDocument(); | ||
|
||
const loadChildrenCheckbox = screen.getByLabelText( | ||
/load all children of jql specified issues/i | ||
); | ||
expect(loadChildrenCheckbox).toBeInTheDocument(); | ||
|
||
const childJqlLabel = screen.queryByLabelText(/optional children jql filters/i); | ||
expect(childJqlLabel).not.toBeInTheDocument(); | ||
}); | ||
|
||
it("shows child JQL input when loadChildren is checked", () => { | ||
render( | ||
<LoadChildren | ||
loadChildren={true} | ||
setLoadChildren={vi.fn()} | ||
childJql="" | ||
setChildJql={vi.fn()} | ||
/> | ||
); | ||
|
||
const childJqlLabel = screen.getByLabelText(/optional children jql filters/i); | ||
expect(childJqlLabel).toBeInTheDocument(); | ||
|
||
const childJqlInput = screen.getByLabelText(/optional children jql filters/i); | ||
expect(childJqlInput).toBeInTheDocument(); | ||
}); | ||
}); |