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

Added card_width argument to gist card #3467

Closed
wants to merge 3 commits into from
Closed

Added card_width argument to gist card #3467

wants to merge 3 commits into from

Conversation

yaten2302
Copy link

@rickstaa, I've created a new PR for adding the card_width argument to the gist card, since there were some issues in the previous one.
Could you also please check that if the changes made in the test file are correct?

Copy link

vercel bot commented Nov 10, 2023

@yaten2302 is attempting to deploy a commit to the github readme stats Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added documentation Improvements or additions to documentation. gist-card labels Nov 10, 2023
api/gist.js Outdated Show resolved Hide resolved
expect(document.querySelector("svg")).toHaveAttribute("width", "400");
});

it("should render with custom width set and limit minimum width", () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

You are performing the same test multiple times. Please consider replacing it with:

  it("should render with custom width set", () => {
    document.body.innerHTML = renderGistCard(data);
    expect(document.querySelector("svg")).toHaveAttribute("width", "400");

    document.body.innerHTML = renderGistCard(data, { card_width: 400 });
    expect(document.querySelector("svg")).toHaveAttribute("width", "400");
  });

  it("should limit minimum width when the custom width is too small", () => {
    document.body.innerHTML = renderGistCard(data, { card_width: 1 });
    expect(document.querySelector("svg")).toHaveAttribute("width", "280");
  });

Copy link
Collaborator

@rickstaa rickstaa left a comment

Choose a reason for hiding this comment

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

@yaten2302, thanks for applying the changes I requested. I made some small last suggestions that should be used, and then the PR is ready for merge 🚀.

yaten2302 and others added 2 commits November 12, 2023 09:53
Co-authored-by: Rick Staa <rick.staa@outlook.com>
@yaten2302
Copy link
Author

@rickstaa, made the changes, could you please review 👍

@yaten2302 yaten2302 closed this by deleting the head repository Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation. gist-card
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants