refactor: move svg rendering related code into separate module (#4588)
Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
This commit is contained in:
co-authored by
Alexandr
parent
33f6276b0b
commit
c43fd65bdd
+1
-1
@@ -13,7 +13,7 @@ import MockAdapter from "axios-mock-adapter";
|
||||
import api from "../api/index.js";
|
||||
import { calculateRank } from "../src/calculateRank.js";
|
||||
import { renderStatsCard } from "../src/cards/stats.js";
|
||||
import { renderError } from "../src/common/utils.js";
|
||||
import { renderError } from "../src/common/render.js";
|
||||
import { CACHE_TTL, DURATIONS } from "../src/common/cache.js";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from "@jest/globals";
|
||||
import { flexLayout } from "../src/common/utils.js";
|
||||
import { flexLayout } from "../src/common/render.js";
|
||||
|
||||
describe("flexLayout", () => {
|
||||
it("should work with row & col layouts", () => {
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ import axios from "axios";
|
||||
import MockAdapter from "axios-mock-adapter";
|
||||
import gist from "../api/gist.js";
|
||||
import { renderGistCard } from "../src/cards/gist.js";
|
||||
import { renderError } from "../src/common/utils.js";
|
||||
import { renderError } from "../src/common/render.js";
|
||||
import { CACHE_TTL, DURATIONS } from "../src/common/cache.js";
|
||||
|
||||
const gist_data = {
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ import axios from "axios";
|
||||
import MockAdapter from "axios-mock-adapter";
|
||||
import pin from "../api/pin.js";
|
||||
import { renderRepoCard } from "../src/cards/repo.js";
|
||||
import { renderError } from "../src/common/utils.js";
|
||||
import { renderError } from "../src/common/render.js";
|
||||
import { CACHE_TTL, DURATIONS } from "../src/common/cache.js";
|
||||
|
||||
const data_repo = {
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
import { describe, expect, it } from "@jest/globals";
|
||||
import { queryByTestId } from "@testing-library/dom";
|
||||
import "@testing-library/jest-dom/jest-globals";
|
||||
import { encodeHTML, renderError } from "../src/common/utils.js";
|
||||
import { encodeHTML, renderError } from "../src/common/render.js";
|
||||
|
||||
describe("Test utils.js", () => {
|
||||
describe("Test render.js", () => {
|
||||
it("should test encodeHTML", () => {
|
||||
expect(encodeHTML(`<html>hello world<,.#4^&^@%!))`)).toBe(
|
||||
"<html>hello world<,.#4^&^@%!))",
|
||||
@@ -6,7 +6,7 @@ import axios from "axios";
|
||||
import MockAdapter from "axios-mock-adapter";
|
||||
import topLangs from "../api/top-langs.js";
|
||||
import { renderTopLanguages } from "../src/cards/top-languages.js";
|
||||
import { renderError } from "../src/common/utils.js";
|
||||
import { renderError } from "../src/common/render.js";
|
||||
import { CACHE_TTL, DURATIONS } from "../src/common/cache.js";
|
||||
|
||||
const data_langs = {
|
||||
|
||||
Reference in New Issue
Block a user