Skip to content
This repository was archived by the owner on Oct 21, 2024. It is now read-only.

Conversation

@erhaneth
Copy link

Overview

REQUIRED
Fill in the overview of this PR, what this PR is trying to achieve

Create challenger welcome component and partner context.

Test Plan

REQUIRED
What you did to verify your PR works as claimed? Make sure to list things/steps/screenshots/screentcasts so that others could reproduce your test easily. Share styling changes and component updates through screenshots

Tested challenger welcome render functionality and completed unit test for challenger welcome and partner context

Follow ups

It is okay for the PR to be not perfect, list what you/other should work on after this PR is merged

@MazharulIslam-Naim
Copy link
Member

Hey Huseyin, great job on your first pr. I saw your having trouble with getting the tests to 100%; I was also having trouble with that. I saw that you need to write a test for line 92 for challenger-welcome.tsx. You code try writing a test similar to this:

it("Displays the inviter's name when inviterInfo is not null.", async () => {
      const inviter = Builder<Inviter>().name('Test Name').build();
      const inviterCtxValue = Builder<InviterContextType>().inviterInfo(inviter).build();
      render(
        <InviterContext.Provider value={inviterCtxValue}>
          <PlayerWelcome />
        </InviterContext.Provider>
      );
      
      const greeting = screen.queryByText(new RegExp(`${inviter.name}'s 8by8 Challenge!`));
      expect(greeting).toBeInTheDocument();
      const content = screen.queryByText(new RegExp(`Help ${inviter.name} win their`));
      expect(content).toBeInTheDocument();
    });

This is from the file playerwelcome.spec.tsx in my latest pr #225. Let me know if you need help.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants