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

tests: refactor stats card e2e test to avoid future error due to yearly data update #3612

Merged
merged 2 commits into from
Jan 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions tests/e2e/e2e.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ const STATS_DATA = {
name: "Cateline Mnemosyne",
totalPRs: 2,
totalReviews: 0,
totalCommits: 1,
totalCommits: 15,
totalIssues: 1,
totalStars: 1,
contributedTo: 1,
rank: {
level: "C",
percentile: 98.38875766503551,
percentile: 98.2625144160878,
},
};

Expand Down Expand Up @@ -120,11 +120,13 @@ describe("Fetch Cards", () => {
).resolves.not.toThrow();

// Get local stats card.
const localStatsCardSVG = renderStatsCard(STATS_DATA);
const localStatsCardSVG = renderStatsCard(STATS_DATA, {
include_all_commits: true,
});

// Get the Vercel preview stats card response.
const serverStatsSvg = await axios.get(
`${VERCEL_PREVIEW_URL}/api?username=${USER}&${CACHE_BURST_STRING}`,
`${VERCEL_PREVIEW_URL}/api?username=${USER}&include_all_commits=true&${CACHE_BURST_STRING}`,
);

// Check if stats card from deployment matches the stats card from local.
Expand Down
Loading