Skip to content

Commit a5fed67

Browse files
committed
Fix merge issues
1 parent bf8204f commit a5fed67

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

Diff for: src/cards/repo-card.js

+5-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
import { repoCardLocales } from "../translations.js";
1919

2020
const ICON_SIZE = 16;
21-
const DESCRIPTION_LINE_WIDTH = 59;
21+
const DESCRIPTION_LINE_WIDTH = 42;
2222
const DESCRIPTION_MAX_LINES = 3;
2323

2424
/**
@@ -91,19 +91,17 @@ const renderRepoCard = (repo, options = {}) => {
9191
: DESCRIPTION_MAX_LINES;
9292

9393
const desc = parseEmojis(description || "No description provided");
94-
const multiLineDescription = show_description ? wrapTextMultiline(
95-
desc,
96-
DESCRIPTION_LINE_WIDTH,
97-
descriptionMaxLines,
98-
) : [];
94+
const multiLineDescription = show_description
95+
? wrapTextMultiline(desc, DESCRIPTION_LINE_WIDTH, descriptionMaxLines)
96+
: [];
9997
const descriptionLinesCount = description_lines_count
10098
? clampValue(description_lines_count, 1, DESCRIPTION_MAX_LINES)
10199
: multiLineDescription.length;
102100
const descriptionSvg = multiLineDescription
103101
.map((line) => `<tspan dy="1.2em" x="25">${encodeHTML(line)}</tspan>`)
104102
.join("");
105103

106-
const height =
104+
let height =
107105
(descriptionLinesCount > 1 ? 120 : 110) +
108106
descriptionLinesCount * lineHeight;
109107
if (!show_description) {

Diff for: tests/__snapshots__/renderWakatimeCard.test.js.snap

+4-4
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ exports[`Test Render WakaTime Card should render correctly with compact layout 1
8787
8888
<g
8989
data-testid="card-title"
90-
transform="translate(25, 35)"
90+
transform="translate(25, 32)"
9191
>
9292
<g transform="translate(0, 0)">
9393
<text
@@ -169,7 +169,7 @@ exports[`Test Render WakaTime Card should render correctly with compact layout w
169169
<desc id="descId"></desc>
170170
<style>
171171
.header {
172-
font: 600 18px 'Segoe UI', Ubuntu, Sans-Serif;
172+
font: 600 17px 'Segoe UI', Ubuntu, Sans-Serif;
173173
fill: #2f80ed;
174174
animation: fadeInAnimation 0.8s ease-in-out forwards;
175175
}
@@ -239,7 +239,7 @@ exports[`Test Render WakaTime Card should render correctly with compact layout w
239239
240240
<g
241241
data-testid="card-title"
242-
transform="translate(25, 35)"
242+
transform="translate(25, 32)"
243243
>
244244
<g transform="translate(0, 0)">
245245
<text
@@ -254,7 +254,7 @@ exports[`Test Render WakaTime Card should render correctly with compact layout w
254254
255255
<g
256256
data-testid="main-card-body"
257-
transform="translate(0, 55)"
257+
transform="translate(0, 52)"
258258
>
259259
260260
<svg x="0" y="0" width="100%">

Diff for: tests/renderRepoCard.test.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ describe("Test renderRepoCard", () => {
6969

7070
expect(
7171
document.getElementsByClassName("description")[0].children[0].textContent,
72-
).toBe("The quick brown fox jumps over the lazy dog is");
72+
).toBe("The quick brown fox jumps over the lazy");
7373

7474
expect(
7575
document.getElementsByClassName("description")[0].children[1].textContent,
76-
).toBe("an English-language pangram—a sentence");
76+
).toBe("dog is an English-language pangram—a");
7777

7878
// Should not trim
7979
document.body.innerHTML = renderRepoCard({
@@ -90,7 +90,9 @@ describe("Test renderRepoCard", () => {
9090
document.body.innerHTML = renderRepoCard(data_repo.repository, {
9191
show_description: false,
9292
});
93-
expect(document.getElementsByClassName("description")[0]).toHaveTextContent("");
93+
expect(document.getElementsByClassName("description")[0]).toHaveTextContent(
94+
"",
95+
);
9496
});
9597

9698
it("should render emojis", () => {

0 commit comments

Comments
 (0)