mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-04-08 08:38:04 -04:00
Update tests (#1404)
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user