Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

test(settings): await both mobile footer actions [skip version]

Juan Denis4dc281ce58b0
diff --git a/frontend/scripts/settings-ui-browser.mjs b/frontend/scripts/settings-ui-browser.mjs
index f604df0d..7b2d55bc 100644
--- a/frontend/scripts/settings-ui-browser.mjs
+++ b/frontend/scripts/settings-ui-browser.mjs
@@ -215,8 +215,11 @@ try {
}
if (pane === 'notifications') {
await page.getByRole('button', { name: 'Save Preferences' }).waitFor();
- const actions = await page.locator('.settings-actions--footer > button').evaluateAll((nodes) => nodes.map((node) => ({ top: node.getBoundingClientRect().top, bottom: node.getBoundingClientRect().bottom })));
- assert(actions[1].top - actions[0].bottom >= 12, 'Mobile footer buttons should stack with a gap');
+ await page.getByRole('button', { name: 'Send Test Notification' }).waitFor();
+ const testAction = await page.getByRole('button', { name: 'Send Test Notification' }).boundingBox();
+ const saveAction = await page.getByRole('button', { name: 'Save Preferences' }).boundingBox();
+ assert(testAction && saveAction, 'Both mobile footer buttons must be visible');
+ assert(saveAction.y - testAction.y - testAction.height >= 12, 'Mobile footer buttons should stack with a gap');
}
}
assert.deepEqual(errors, []);