allow bulk-imported contacts to have visibility set

This commit is contained in:
2024-09-17 18:30:50 -06:00
parent 61a488a25d
commit 534f3d8a8b
10 changed files with 166 additions and 86 deletions

View File

@@ -176,4 +176,22 @@ test('Add contact, copy details, delete, and import various ways', async ({ page
await page.locator('button', { hasText: 'Import' }).click();
// check that there are more contacts
await expect(page.getByTestId('contactListItem')).toHaveCount(2);
// Import via the file backup-import
await page.goto('./account');
await page.getByRole('heading', { name: 'Advanced' }).click();
const fileSelect = await page.locator('input[type="file"]')
//fileSelect.click();
fileSelect.setInputFiles('./test-playwright/exported-data.json');
await page.locator('button', { hasText: 'Import Only Contacts' }).click();
// we're on the contact-import page
await expect(page.locator('li', { hasText: '- New' })).toHaveCount(3);
await expect(page.locator('li', { hasText: '- Existing' })).toHaveCount(1);
await expect(page.locator('span').filter({ hasText: 'the same as' })).toBeHidden();
await page.locator('button', { hasText: 'Import' }).click();
// check that there are more contacts
await expect(page.getByTestId('contactListItem')).toHaveCount(5);
// The visibility error is because currently the server returns an error for the same person.
// But it should only show that one, for User #000.
});

View File

@@ -0,0 +1,86 @@
{
"formatName": "dexie",
"formatVersion": 1,
"data": {
"databaseName": "TimeSafari",
"databaseVersion": 4,
"tables": [
{
"name": "contacts",
"schema": "did,name",
"rowCount": 12
},
{
"name": "logs",
"schema": "date",
"rowCount": 0
},
{
"name": "settings",
"schema": "id,&accountDid",
"rowCount": 2
},
{
"name": "temp",
"schema": "id",
"rowCount": 0
}
],
"data": [{
"tableName": "contacts",
"inbound": true,
"rows": [
{
"did": "did:ethr:0x0000694B58C2cC69658993A90D3840C560f2F51F",
"name": "User #00",
"publicKeyBase64": "A7Ix5zQT8dNrMyd2OtmkS7gfyRSAoUl3qzz9Mt8FZK8d",
"nextPubKeyHashB64": "d9D/wZLUvI/EyOiMKyxcml0uPKrTh5T0tMGcQjjaqE4=",
"seesMe": false
},
{
"did": "did:ethr:0x0Fc2683554C20B3Ea75aa5bf77B3519005082037",
"name": "tester",
"nextPubKeyHashB64": "CCOqpInfn4Exg7rIdiUxU+K+BUr5GQUVdSmN6SHOHKs=",
"profileImageUrl": 0,
"publicKeyBase64": "AnWEewlbkBH7Q+DZgAglXkqd3Ufxvqvf5OcjenO62Opl",
"registered": true,
"seesMe": true
},
{
"did": "did:ethr:0x111d15564f824D56C7a07b913aA7aDd03382aA39",
"name": "User 111",
"nextPubKeyHashB64": "ge3fGAoxP+Ak48UFg2u9BPdd4ircmvqT34p9spU+h5M=",
"profileImageUrl": "https://test-image.timesafari.app/6b3cba6970f44a883bcbaf302384c50f9b0940e4812ac188649a3b9ec0ebada9.png",
"publicKeyBase64": "A1HdQoCMRkWkTgBvTcJFT6tZ6EXIWZaa0aFsnYNzfE/L",
"registered": true,
"seesMe": true
},
{
"did": "did:peer:0zKMFjvUgYrM1hXwDciKXRoR8dd5PXWoHxAFQZ9jU46wURZizUC128RpzpEc6CpzxQWMdHVS5b3W91yGR6hLUkfcC7UdLtU5jB2fW5TMrQTUte",
"name": "did:peer ixroo",
"publicKeyBase64": 0,
"nextPubKeyHashB64": 0,
"registered": true,
"seesMe": true
}
]
},{
"tableName": "settings",
"inbound": true,
"rows": [
{
"id": 1,
"activeDid": "did:ethr:0x0000694B58C2cC69658993A90D3840C560f2F51F",
"apiServer": "https://test-api.endorser.ch",
"lastViewedClaimId": "01J7SCRCJBYHS3RQWFP9EHXYJZ",
"firstName": "Me"
},
{
"isRegistered": false,
"accountDid": "did:ethr:0x0Fc2683554C20B3Ea75aa5bf77B3519005082037",
"id": 2
}
]
}]
}
}