mirror of
https://github.com/tiennm99/github-readme-stats.git
synced 2026-08-09 08:22:47 +00:00
fix: Make WakaTime card compatible with new API (#2707)
* fix: Make WakaTime card compatible with new API This commit makes sure that the WakaTime card works with the new WakaTime API. See https://github.com/anuraghazra/github-readme-stats/issues/2698 for more information. * fix: fix chinese simplified translations * fix: improve WakaTime range order * test: fix WakaTime tests * refactor: remove WakaTime range loop * refactor: remove redundant WakaTime call * test: fix e2e tests Co-authored-by: Hakula Chen <i@hakula.xyz> --------- Co-authored-by: Hakula Chen <i@hakula.xyz>
This commit is contained in:
@@ -123,7 +123,7 @@ exports[`Test Render Wakatime Card should render correctly with compact layout 1
|
||||
y="0"
|
||||
class="header"
|
||||
data-testid="header"
|
||||
>Wakatime Stats</text>
|
||||
>Wakatime Stats (last 7 days)</text>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
@@ -303,7 +303,7 @@ exports[`Test Render Wakatime Card should render correctly with compact layout w
|
||||
y="0"
|
||||
class="header"
|
||||
data-testid="header"
|
||||
>Wakatime Stats</text>
|
||||
>Wakatime Stats (last 7 days)</text>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ const WAKATIME_DATA = {
|
||||
is_up_to_date: false,
|
||||
is_up_to_date_pending_future: false,
|
||||
percent_calculated: 0,
|
||||
range: "last_7_days",
|
||||
range: "all_time",
|
||||
status: "pending_update",
|
||||
timeout: 15,
|
||||
username: USER,
|
||||
|
||||
@@ -105,7 +105,7 @@ describe("Wakatime fetcher", () => {
|
||||
const username = "anuraghazra";
|
||||
mock
|
||||
.onGet(
|
||||
`https://wakatime.com/api/v1/users/${username}/stats/all_time?is_including_today=true`,
|
||||
`https://wakatime.com/api/v1/users/${username}/stats?is_including_today=true`,
|
||||
)
|
||||
.reply(200, wakaTimeData);
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ describe("Test Render Wakatime Card", () => {
|
||||
expect(
|
||||
document.querySelector('g[transform="translate(0, 0)"]>text.stat.bold')
|
||||
.textContent,
|
||||
).toBe("本周没有编程活动");
|
||||
).toBe("Wakatime 用户个人资料未公开");
|
||||
});
|
||||
|
||||
it("should render without rounding", () => {
|
||||
|
||||
Reference in New Issue
Block a user