Skip to content

Commit

Permalink
Test actual strings intead of keys
Browse files Browse the repository at this point in the history
  • Loading branch information
lidimayra committed Jul 18, 2022
1 parent b5a4584 commit 1b51258
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/v2/Components/NavBar/__tests__/NavBar.jest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { mount } from "enzyme"
import { NavBar } from "../NavBar"
import { NavBarMobileMenuInboxNotificationCount } from "../NavBarMobileMenu/NavBarMobileMenuInboxNotificationCount"
import { mediator } from "lib/mediator"
import "v2/System/i18n/i18n"

jest.mock("v2/Components/Search/SearchBar", () => {
return {
Expand Down Expand Up @@ -62,17 +63,17 @@ describe("NavBar", () => {
describe("desktop", () => {
it("renders logged out items", () => {
const wrapper = getWrapper()
expect(wrapper.html()).toContain("navbar.login")
expect(wrapper.html()).toContain("navbar.signup")
expect(wrapper.html()).toContain("Log In")
expect(wrapper.html()).toContain("Sign up")
expect(wrapper.find(BellIcon).length).toEqual(0)
expect(wrapper.find(SoloIcon).length).toEqual(0)
})

it("renders logged in items", () => {
// @ts-expect-error PLEASE_FIX_ME_STRICT_NULL_CHECK_MIGRATION
const wrapper = getWrapper({ user: true })
expect(wrapper.html()).not.toContain("navbar.login")
expect(wrapper.html()).not.toContain("navbar.signup")
expect(wrapper.html()).not.toContain("Log In")
expect(wrapper.html()).not.toContain("Sign up")
expect(wrapper.find(BellIcon).length).toEqual(1)
expect(wrapper.find(SoloIcon).length).toEqual(1)
})
Expand Down

0 comments on commit 1b51258

Please sign in to comment.