stakwork / sphinx-tribes-frontend

Frontend for sphinx tribes and bounties. The bounty platform that pays out in bitcoin. Sign up with Sphinx Chat, complete a bounty, and earn bitcoin! Go to our website for available bounties.
https://community.sphinx.chat/bounties
12 stars 42 forks source link

Fixed org description not visible for signed out user #289

Closed chiragDork closed 8 months ago

chiragDork commented 8 months ago

Describe your changes

Fixed org description not visible for signed out user

Screenshot from 2024-02-22 13-58-48

Issue ticket number and link

issue: #284

Type of change

ui change

Please delete options that are not relevant.

Checklist before requesting a review

chiragDork commented 8 months ago

Hi @ecurrencyhodler I have fixed the isuse and raised PR

elraphty commented 8 months ago

284

@chiragDork Please right a test for your change

chiragDork commented 8 months ago

@elraphty the test is already covered in the testing file

chiragDork commented 8 months ago

Screenshot from 2024-02-22 18-58-06

elraphty commented 8 months ago

@elraphty the test is already covered in the testing file

Post a Bounty button should not be visible if the user is not logged in

  it('renders the component correctly', async () => {
    render(<OrgHeader {...MockProps} />);
    waitFor(() => {
      expect(screen.findByText(MockProps.organizationData.name ?? '')).toBeInTheDocument();
      expect(screen.findByText(MockProps.organizationData.description ?? '')).toBeInTheDocument();
      expect(screen.getByText('Post a Bounty')).toBeInTheDocument();
      expect(screen.getByText('Status')).toBeInTheDocument();
      expect(screen.getByText('Skill')).toBeInTheDocument();
      expect(screen.getByPlaceholderText('Search')).toBeInTheDocument();
      expect(screen.getByText(/Bounties/i)).toBeInTheDocument();
    });
  });

This test doesn't test for that.

elraphty commented 8 months ago

@elraphty the test is already covered in the testing file

Post a Bounty button should not be visible if the user is not logged in

  it('renders the component correctly', async () => {
    render(<OrgHeader {...MockProps} />);
    waitFor(() => {
      expect(screen.findByText(MockProps.organizationData.name ?? '')).toBeInTheDocument();
      expect(screen.findByText(MockProps.organizationData.description ?? '')).toBeInTheDocument();
      expect(screen.getByText('Post a Bounty')).toBeInTheDocument();
      expect(screen.getByText('Status')).toBeInTheDocument();
      expect(screen.getByText('Skill')).toBeInTheDocument();
      expect(screen.getByPlaceholderText('Search')).toBeInTheDocument();
      expect(screen.getByText(/Bounties/i)).toBeInTheDocument();
    });
  });

This test doesn't test for that.

It covers that the description is always visible, so add the test for the visibility for Post a Bounty

chiragDork commented 8 months ago

@elraphty I have added the test, Thanks

kevkevinpal commented 8 months ago

@elraphty I have added the test, Thanks

@chiragDork there is still only one file changed in this PR

I would take the same test @elraphty posted and then make meInfo empty

The change looks good otherwise!

chiragDork commented 8 months ago

Hi @kevkevinpal sorry I missed to add the test file to the commit, I have made the commit again, can you please check and let me know if everything is okay now. Thanks.

elraphty commented 8 months ago

@elraphty I have added the test, Thanks

@chiragDork there is still only one file changed in this PR

I would take the same test @elraphty posted and then make meInfo empty

The change looks good otherwise!

@chiragDork do this, make the meInfo empty, then write a new test with a populated meInfo, and assert that the Post bounty button is visible.

ecurrencyhodler commented 8 months ago

Tested and paid! https://community.sphinx.chat/bounty/1564