test: Fixed welcome page tests and added empty tab checks, b=no-bug, c=tests, tabs, welcome

This commit is contained in:
Mr. M
2025-08-19 14:34:38 +02:00
parent e7a9aba3c0
commit 850ea775de
3 changed files with 35 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ support-files = [
"head.js",
]
["browser_tabs_empty_checks.js"]
["browser_drag_drop_vertical.js"]
tags = [
"drag-drop",

View File

@@ -0,0 +1,28 @@
/* Any copyright is dedicated to the Public Domain.
https://creativecommons.org/publicdomain/zero/1.0/ */
'use strict';
add_task(async function test_Empty_Tab_Transparent() {
const emptyTab = gZenWorkspaces._emptyTab;
ok(emptyTab, 'Empty tab should exist');
ok(emptyTab.parentElement, 'Empty tab should be in the DOM');
ok(emptyTab.hasAttribute('zen-empty-tab'), 'Empty tab should have the zen-empty-tab attribute');
ok(
emptyTab.linkedBrowser.hasAttribute('transparent'),
'Empty tab should have the transparent attribute'
);
});
add_task(async function test_Empty_Tab_Always_First() {
ok(gBrowser.tabs[0].hasAttribute('zen-empty-tab'), 'First tab should be the empty tab');
await BrowserTestUtils.withNewTab(
{
gBrowser,
url: 'http://example.com',
},
async () => {
ok(gBrowser.tabs[0].hasAttribute('zen-empty-tab'), 'First tab should be the empty tab');
}
);
});

View File

@@ -168,7 +168,12 @@ add_task(async function test_Welcome_Steps() {
}
group.delete();
resolve();
}, 5000); // Wait for the transition to complete
}, 3000); // Wait for the transition to complete
});
for (const tab of gBrowser.tabs) {
if (tab.pinned) {
gBrowser.removeTab(tab);
}
}
ok(true, 'Welcome process completed successfully');
});