Update tests (#1404)

This commit is contained in:
Leendert de Borst
2025-12-09 22:21:29 +01:00
parent b8c11e02fd
commit c8fa9255cf
4 changed files with 9 additions and 17 deletions

View File

@@ -102,10 +102,10 @@ const ItemsList: React.FC = () => {
/**
* Handle add new item.
* Navigate to item type selector for new item-based flow.
* Navigate directly to add item page (defaults to Login type).
*/
const handleAddItem = useCallback(() : void => {
navigate('/items/select-type');
navigate('/items/add');
}, [navigate]);
/**
@@ -579,7 +579,7 @@ const ItemsList: React.FC = () => {
{/* Items */}
{filteredItems.length > 0 && (
<ul className="space-y-2">
<ul id="items-list" className="space-y-2">
{filteredItems.map(item => (
<ItemCard
key={item.Id}

View File

@@ -290,6 +290,8 @@
"selectType": "Add New Item",
"selectTypeDescription": "Choose the type of item you want to create",
"typeLabel": "Item Type",
"creating": "Creating",
"generateAlias": "Generate random alias",
"login": {
"title": "Login",
"description": "Username, password, and website credentials"

View File

@@ -90,20 +90,10 @@ test.describe.serial('5. Vault Merge', () => {
test('5.5 Client A should see credentials after syncing', async () => {
await clientA
.goToVault()
.triggerSync()
.then((c) => c.verifyCredentialExists(credentialNameA))
.then((c) => c.screenshot('5.5-client-a-vault-state.png'));
const clientBCredential = clientA.popup.locator(`text=${credentialNameB}`);
const hasBothCredentials = await clientBCredential.isVisible().catch(() => false);
if (hasBothCredentials) {
await clientA.screenshot('5.5-client-a-synced-both.png');
await clientA.verifyVaultItemCount(2);
} else {
await clientA.screenshot('5.5-client-a-only-own-credential.png');
const itemsText = clientA.popup.locator('text=/\\(1 items?\\)/');
await expect(itemsText).toBeVisible({ timeout: 5000 });
}
await clientA.verifyVaultItemCount(2);
});
});

View File

@@ -303,8 +303,8 @@ export class TestClient {
* Verify the vault shows a specific item count.
*/
async verifyVaultItemCount(count: number): Promise<this> {
const itemsText = this.popup.locator(`text=/\\(${count} items?\\)/`);
await expect(itemsText).toBeVisible({ timeout: Timeouts.SHORT });
const itemsList = this.popup.locator('ul#items-list > li');
await expect(itemsList).toHaveCount(count, { timeout: Timeouts.SHORT });
return this;
}