Skip to content

Commit

Permalink
πŸ§ͺ 231006: ν…ŒμŠ€νŠΈμ½”λ“œ μˆ˜μ •
Browse files Browse the repository at this point in the history
### ν…ŒμŠ€νŠΈμ½”λ“œ μˆ˜μ •
* λ³€κ²½λœ 사항에 λ§žλ„λ‘ ν…ŒμŠ€νŠΈ μˆ˜μ •
  • Loading branch information
HTMLhead authored Oct 6, 2023
2 parents 1ac732c + 22fed53 commit f9b239d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,39 +25,45 @@ describe("<HomeGlobalNavigationBar>", () => {

getByText(LINK.MASTERS);
});
it("λ§ˆμŠ€ν„°μ¦ˆ λ²„νŠΌμ„ ν΄λ¦­ν•˜λ©΄ ν”„λ¦¬μ½”μŠ€, λ§ˆμŠ€ν„°μ¦ˆβ€’max 링크가 보여진닀.", async () => {
const { getByText } = renderHomeGlobalNavigationBar();

const mastersBtn = getByText(LINK.MASTERS);
fireEvent.click(mastersBtn);
it("λ§ˆμŠ€ν„°μ¦ˆ 링크λ₯Ό ν΄λ¦­ν•˜λ©΄ λ§ˆμŠ€ν„°μ¦ˆ νŽ˜μ΄μ§€λ‘œ μ΄λ™λœλ‹€.", async () => {
const { getByRole } = renderHomeGlobalNavigationBar();

getByText(LINK.PRE_COURSE);
getByText(LINK.MASTERS_MAX);
const linkEle = getByRole("link", { name: LINK.MASTERS });
expect(linkEle?.getAttribute("href")).toBe(INTERNAL.MASTERS);
});
const whenMastersPopoverOpened = () => {
const utils = renderHomeGlobalNavigationBar();
const { getByText } = utils;
// it("λ§ˆμŠ€ν„°μ¦ˆ λ²„νŠΌμ„ ν΄λ¦­ν•˜λ©΄ ν”„λ¦¬μ½”μŠ€, λ§ˆμŠ€ν„°μ¦ˆβ€’max 링크가 보여진닀.", async () => {
// const { getByText } = renderHomeGlobalNavigationBar();

const mastersBtn = getByText(LINK.MASTERS);
fireEvent.click(mastersBtn);
// const mastersBtn = getByText(LINK.MASTERS);
// fireEvent.click(mastersBtn);

getByText(LINK.PRE_COURSE);
getByText(LINK.MASTERS_MAX);
// getByText(LINK.PRE_COURSE);
// getByText(LINK.MASTERS_MAX);
// });
// const whenMastersPopoverOpened = () => {
// const utils = renderHomeGlobalNavigationBar();
// const { getByText } = utils;

return utils;
};
it("ν”„λ¦¬μ½”μŠ€ μ½”μŠ€ 링크λ₯Ό ν΄λ¦­ν•˜λ©΄ λ§ˆμŠ€ν„°μ¦ˆμ½”μŠ€ νŽ˜μ΄μ§€λ‘œ μ΄λ™λœλ‹€.", async () => {
const { getByRole } = whenMastersPopoverOpened();
// const mastersBtn = getByText(LINK.MASTERS);
// fireEvent.click(mastersBtn);

const linkEle = getByRole("link", { name: LINK.PRE_COURSE });
expect(linkEle?.getAttribute("href")).toBe(INTERNAL.PRE_COURSE);
});
it("λ§ˆμŠ€ν„°μ¦ˆβ€’max 링크λ₯Ό ν΄λ¦­ν•˜λ©΄ λ§ˆμŠ€ν„°μ¦ˆμ½”μŠ€ νŽ˜μ΄μ§€λ‘œ μ΄λ™λœλ‹€.", async () => {
const { getByRole } = whenMastersPopoverOpened();
// getByText(LINK.PRE_COURSE);
// getByText(LINK.MASTERS_MAX);

const linkEle = getByRole("link", { name: LINK.MASTERS_MAX });
expect(linkEle?.getAttribute("href")).toBe(INTERNAL.MASTERS);
});
// return utils;
// };
// it("ν”„λ¦¬μ½”μŠ€ μ½”μŠ€ 링크λ₯Ό ν΄λ¦­ν•˜λ©΄ λ§ˆμŠ€ν„°μ¦ˆμ½”μŠ€ νŽ˜μ΄μ§€λ‘œ μ΄λ™λœλ‹€.", async () => {
// const { getByRole } = whenMastersPopoverOpened();

// const linkEle = getByRole("link", { name: LINK.PRE_COURSE });
// expect(linkEle?.getAttribute("href")).toBe(INTERNAL.PRE_COURSE);
// });
// it("λ§ˆμŠ€ν„°μ¦ˆβ€’max 링크λ₯Ό ν΄λ¦­ν•˜λ©΄ λ§ˆμŠ€ν„°μ¦ˆμ½”μŠ€ νŽ˜μ΄μ§€λ‘œ μ΄λ™λœλ‹€.", async () => {
// const { getByRole } = whenMastersPopoverOpened();

// const linkEle = getByRole("link", { name: LINK.MASTERS_MAX });
// expect(linkEle?.getAttribute("href")).toBe(INTERNAL.MASTERS);
// });
it("μ½”λ“œνˆ¬κ²Œλ” 링크λ₯Ό ν΄λ¦­ν•˜λ©΄ μ½”λ“œνˆ¬κ²Œλ” νŽ˜μ΄μ§€λ‘œ μ΄λ™λœλ‹€.", async () => {
const { getByRole } = renderHomeGlobalNavigationBar();

Expand Down
8 changes: 4 additions & 4 deletions src/pageComponents/main/CourseList/CourseList.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ describe("<CourseList>", () => {
<CourseList />
</TestProvider>
);
it("ν”„λ¦¬μ½”μŠ€ 링크가 보여진닀.", async () => {
it("λ§ˆμŠ€ν„°μ¦ˆ 링크가 보여진닀.", async () => {
const { getByText, getAllByRole } = renderCourseList();
getByText(LINK.PRE_COURSE);
getByText(LINK_DESCRIPTION.PRE_COURSE);
getByText(LINK.MASTERS);
getByText(LINK_DESCRIPTION.MASTERS);

const [preCourseLink] = getAllByRole("link");
expect(preCourseLink?.getAttribute("href")).toBe(INTERNAL.PRE_COURSE);
expect(preCourseLink?.getAttribute("href")).toBe(INTERNAL.MASTERS);
});
it("μ½”λ“œνˆ¬κ²Œλ” 링크가 보여진닀.", async () => {
const { getByText, getAllByRole } = renderCourseList();
Expand Down

0 comments on commit f9b239d

Please sign in to comment.