Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#548 P0: Chris/fix previous picks #549

Merged
merged 5 commits into from
Sep 20, 2024
Merged

Conversation

chris-nowicki
Copy link
Contributor

@chris-nowicki chris-nowicki commented Sep 20, 2024

fixes #548

  • shows a week as No Pick if the user didn't select a pick for a previous week.

SCREEN SHOTS

CleanShot_2024-09-19_at_19 21 01

CleanShot_2024-09-19_at_19 30 08

Copy link

appwrite bot commented Sep 20, 2024

Gridiron Survivor Application 6616ea581ef9f5521c7d

Function ID Status Action
Your function deployment has failed. Please check the logs for more details and retry.

Project name: Gridiron Survivor Application
Project ID: 6616ea581ef9f5521c7d

Function ID Status Action
userAuth 6626fef885a9f630442b failed Failed View Logs

Only deployments on the production branch are activated automatically. If you'd like to activate this deployment, navigate to your deployments. Learn more about Appwrite Function deployments.

💡 Did you know?
Cursor pagination performs better than offset pagination when loading further pages

Copy link

vercel bot commented Sep 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gridiron-survivor ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 20, 2024 2:55pm
gridiron-survivor-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 20, 2024 2:55pm

/>
) : (
<span
className="text-xs h-16 w-16 text-primary pt-6 text-center"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm worried about the a11y of the color and the small text size, did you check this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ryandotfurrer I did not check this. hmmmmm @shashilo what do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine for now. A11Y audit can come after.

/>
) : (
<span
className="text-xs h-10 w-full text-primary pt-2"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm worried about the a11y of the color and the small text size, did you check this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ryandotfurrer I did not check this. hmmmmm @shashilo what do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine for now. A11Y audit can come after.

() => {
expect(screen.getByTestId('weekly-picks')).toBeInTheDocument();
},
{ timeout: 5000 },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: is this an arbitrary number for the timeout or is there a reason for using 5000?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jennifertieu great comment! I am not sure! LOL .... I removed it. I think initially I had a pause in something somewhere that caused the test to have to wait to see it in the DOM.

✅ removed and tests still work.

{ timeout: 5000 },
);

expect(screen.getByTestId('user-pick-history')).toBeInTheDocument();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I know there was a conversation on your other PR about declaring variable vs inline but I think this scenario where you have to write screen.getByTestId('user-pick-history') twice is a good use case to save it in a variable instead to reuse.

Both approaches work though! The code still runs but might save you or someone else in the future sometime. Of course, we'll see what Shashi thinks because I'm curious which is better or how much it matters😅.

Copy link
Collaborator

@shashilo shashilo Sep 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When there's more than 2, that's always a good case to make a variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shashilo @jennifertieu thanks! yes, moving forward I will be doing this when there are more than 2.

expect(userPickHistoryLogos).toHaveLength(1);
expect(userPickHistoryLogos[0]).toHaveAttribute(
'src',
'/_next/image?url=https%3A%2F%2Fexample.com%2Fbrowns.png&w=128&q=75',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Why is the URL string encoded like this instead of url=https://example.com/browns.png? (same questions with the other URLs)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jennifertieu great question! the component is using Next Image. This is how Next Image formats the url for images so it can apply its customizations.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chris-nowicki replying late lol but that is good to know!! I'll keep that in mind when testing with Next in the future, thanks Chris!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Previous Week Pick shows empty logo if null
4 participants