test: cleanup tests

This commit is contained in:
rickstaa 2022-10-09 15:18:11 +02:00
parent 60012707c7
commit fcd0588786
No known key found for this signature in database
GPG Key ID: 0BD7401D30D23E53
4 changed files with 33 additions and 29 deletions

View File

@ -11,7 +11,6 @@ import { renderStatsCard } from "../../src/cards/stats-card.js";
import { renderTopLanguages } from "../../src/cards/top-languages-card.js";
import { renderWakatimeCard } from "../../src/cards/wakatime-card.js";
// Script variables
const REPO = "dummy-cra";
const USER = "grsdummy";
const STATS_DATA = {
@ -26,6 +25,7 @@ const STATS_DATA = {
score: 51.01013099671447,
},
};
const LANGS_DATA = {
TypeScript: {
color: "#3178c6",
@ -48,6 +48,7 @@ const LANGS_DATA = {
size: 671,
},
};
const WAKATIME_DATA = {
human_readable_range: "last week",
is_already_updating: false,
@ -64,6 +65,7 @@ const WAKATIME_DATA = {
username: "grsdummy",
writes_only: false,
};
const REPOSITORY_DATA = {
name: "dummy-cra",
nameWithOwner: "grsdummy/dummy-cra",
@ -82,6 +84,7 @@ const REPOSITORY_DATA = {
forkCount: 0,
starCount: 1,
};
const CACHE_BURST_STRING = `v=${new Date().getTime()}`;
describe("Fetch Cards", () => {

View File

@ -23,6 +23,7 @@ const data_user = {
organization: null,
},
};
const data_org = {
data: {
user: null,

View File

@ -10,17 +10,17 @@ import "@testing-library/jest-dom";
import { themes } from "../themes/index.js";
describe("Test renderStatsCard", () => {
const stats = {
name: "Anurag Hazra",
totalStars: 100,
totalCommits: 200,
totalIssues: 300,
totalPRs: 400,
contributedTo: 500,
rank: { level: "A+", score: 40 },
};
const stats = {
name: "Anurag Hazra",
totalStars: 100,
totalCommits: 200,
totalIssues: 300,
totalPRs: 400,
contributedTo: 500,
rank: { level: "A+", score: 40 },
};
describe("Test renderStatsCard", () => {
it("should render correctly", () => {
document.body.innerHTML = renderStatsCard(stats);

View File

@ -9,25 +9,25 @@ import "@testing-library/jest-dom";
import { themes } from "../themes/index.js";
describe("Test renderTopLanguages", () => {
const langs = {
HTML: {
color: "#0f0",
name: "HTML",
size: 200,
},
javascript: {
color: "#0ff",
name: "javascript",
size: 200,
},
css: {
color: "#ff0",
name: "css",
size: 100,
},
};
const langs = {
HTML: {
color: "#0f0",
name: "HTML",
size: 200,
},
javascript: {
color: "#0ff",
name: "javascript",
size: 200,
},
css: {
color: "#ff0",
name: "css",
size: 100,
},
};
describe("Test renderTopLanguages", () => {
it("should render correctly", () => {
document.body.innerHTML = renderTopLanguages(langs);