feat: improved top lang fetching & changed title

This commit is contained in:
anuraghazra
2020-07-28 23:33:43 +05:30
parent f7f8ee7ba0
commit 826f0201aa
4 changed files with 10 additions and 14 deletions

View File

@ -32,7 +32,7 @@ describe("Test renderTopLanguages", () => {
document.body.innerHTML = renderTopLanguages(langs);
expect(queryByTestId(document.body, "header")).toHaveTextContent(
"Top Languages"
"Most Used Languages"
);
expect(queryAllByTestId(document.body, "lang-name")[0]).toHaveTextContent(
@ -211,7 +211,7 @@ describe("Test renderTopLanguages", () => {
it('should render with layout compact', () => {
document.body.innerHTML = renderTopLanguages(langs, {layout: 'compact'});
expect(queryByTestId(document.body, "header")).toHaveTextContent("Top Languages");
expect(queryByTestId(document.body, "header")).toHaveTextContent("Most Used Languages");
expect(queryAllByTestId(document.body, "lang-name")[0]).toHaveTextContent("HTML 40.00%");
expect(queryAllByTestId(document.body, "lang-progress")[0]).toHaveAttribute("width","120.00");

View File

@ -12,7 +12,7 @@ const data_langs = {
nodes: [
{
languages: {
edges: [{ size: 100, node: { color: "#0f0", name: "HTML" } }],
edges: [{ size: 150, node: { color: "#0f0", name: "HTML" } }],
},
},
{
@ -55,7 +55,7 @@ const langs = {
HTML: {
color: "#0f0",
name: "HTML",
size: 200,
size: 250,
},
javascript: {
color: "#0ff",