chore: Added more tests and debug points for twilight, b=(no-bug), c=common, workspaces, tests

This commit is contained in:
Mr. M
2025-05-09 17:42:38 +02:00
parent 7a00f3c67c
commit 49a3974b34
4 changed files with 38 additions and 7 deletions

View File

@@ -3,11 +3,26 @@
'use strict';
add_setup(async function () {
await ZenWorkspaces.createAndSaveWorkspace('Test Workspace 2');
});
add_setup(async function () {});
add_task(async function test_Check_Creation() {
const currentWorkspaceUUID = ZenWorkspaces.activeWorkspace;
await ZenWorkspaces.createAndSaveWorkspace('Test Workspace 2');
const workspaces = await ZenWorkspaces._workspaces();
ok(workspaces.workspaces.length, 2);
ok(workspaces.workspaces.length === 2, 'Two workspaces should exist.');
ok(currentWorkspaceUUID !== workspaces.workspaces[1].uuid, 'The new workspace should be different from the current one.');
let newTab = BrowserTestUtils.addTab(gBrowser, 'about:blank', {
skipAnimation: true,
});
ok(newTab, 'New tab should be opened.');
ok(gBrowser.tabs.length === 2, 'There should be two tabs.');
BrowserTestUtils.removeTab(newTab);
await ZenWorkspaces.removeWorkspace(ZenWorkspaces.activeWorkspace);
const workspacesAfterRemove = await ZenWorkspaces._workspaces();
ok(workspacesAfterRemove.workspaces.length, 1);
ok(workspacesAfterRemove.workspaces[0].uuid === currentWorkspaceUUID, 'The workspace should be the one we started with.');
ok(gBrowser.tabs.length, 1);
});