mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-14 05:06:16 -08:00
fix(settings): show the installed version without the GitHub release check (#1879)
The settings facade filled its version signal only inside the GitHub releases callback, so offline or under an api.github.com rate limit the installed version was missing from the sidebar's About item and the About page. The version is known locally from DataService, so the signal starts with it. The release check also gets an error handler: SettingsService already logs the failure, and without it the error resurfaced uncaught. The sidebar layout E2E no longer needs to stub the releases request; a new E2E aborts it and expects the version in both places. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
91e277e9ba
commit
039238b7bc
4 files changed
+72
-12
No files matched your search
@@ -232,14 +232,6 @@ test.describe('Settings', () => {
|
||||
test('@settings @web About keeps its label and clears the window bottom', async ({
|
||||
page,
|
||||
}) => {
|
||||
// The sidebar shows the version only once the GitHub releases check
|
||||
// answers; CI runners are often rate-limited there, so answer locally
|
||||
// with an older release (no update badge replaces the version).
|
||||
await page.route('**/repos/4gray/iptvnator/releases*', (route) =>
|
||||
route.fulfill({
|
||||
json: [{ created_at: '2020-01-01T00:00:00Z', name: '0.0.1' }],
|
||||
})
|
||||
);
|
||||
await openSettings(page);
|
||||
const about = page.locator(
|
||||
'.settings-nav__footer [data-test-id="settings-section-about"]'
|
||||
@@ -279,6 +271,29 @@ test.describe('Settings', () => {
|
||||
).toBeGreaterThanOrEqual(12);
|
||||
});
|
||||
|
||||
test('@settings @web The installed version shows while GitHub is unreachable', async ({
|
||||
page,
|
||||
}) => {
|
||||
// Offline, or rate-limited by api.github.com: the release check never
|
||||
// answers, yet the installed version is known locally.
|
||||
await page.route('**/repos/4gray/iptvnator/releases*', (route) =>
|
||||
route.abort()
|
||||
);
|
||||
await openSettings(page);
|
||||
|
||||
const version = /\d+\.\d+\.\d+/;
|
||||
await expect(
|
||||
page.locator(
|
||||
'[data-test-id="settings-section-about"] [data-test-id="settings-nav-version"]'
|
||||
)
|
||||
).toHaveText(version);
|
||||
|
||||
await openSettingsSection(page, 'about');
|
||||
await expect(page.locator('[data-test-id="app-version"]')).toHaveText(
|
||||
version
|
||||
);
|
||||
});
|
||||
|
||||
test('@settings @web Esc leaves settings like the header Back', async ({
|
||||
page,
|
||||
}) => {
|
||||
|
||||
Reference in new issue
Block a user