Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*
*/

import {useId} from 'react';

import {VerificationBadges} from 'Components/Badge';
import {t} from 'Util/localizerUtil';
import {splitFingerprint} from 'Util/stringUtil';
Expand All @@ -31,14 +33,18 @@ interface ProteusDeviceDetailsProps extends Omit<DeviceProps, 'getDeviceIdentity
}

export const ProteusDeviceDetails = ({device, fingerprint, isProteusVerified}: ProteusDeviceDetailsProps) => {
const proteusLabelId = useId();

return (
<div className="preferences-proteus-details">
<h4>{t('proteusDeviceDetails')}</h4>

<div>
<p className="label preferences-label preferences-devices-fingerprint-label">{t('proteusID')}</p>
<p id={proteusLabelId} className="label preferences-label preferences-devices-fingerprint-label">
{t('proteusID')}
</p>

<p className="preferences-devices-fingerprint" css={{width: '230px'}}>
<p className="preferences-devices-fingerprint" css={{width: '230px'}} aria-labelledby={proteusLabelId}>
<FormattedId idSlices={splitFingerprint(device.id)} />
</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ export class DevicesPage {
readonly activeDevices: Locator;

constructor(page: Page) {
// The id is not using any label or similar but just multiple paragraphs beneath each other
this.proteusId = page.locator("p:text('Proteus ID') + p");
this.proteusId = page.getByLabel('Proteus ID');
this.activeDevices = page.getByRole('group', {name: 'Active'}).getByRole('button', {name: /device details/});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,14 @@ test.describe('Authentication', () => {
await components.conversationSidebar().sidebar.waitFor({state: 'visible', timeout: LOGIN_TIMEOUT});
});

let proteusId: string;
await test.step('Open device settings and get current proteus id', async () => {
const proteusId = await test.step('Open device settings and get current proteus id', async () => {
await components.conversationSidebar().clickPreferencesButton();
await pages.settings().devicesButton.click();

proteusId = (await pages.devices().proteusId.textContent()) ?? '';
expect(proteusId).toBeTruthy();
const proteusId = (await pages.devices().proteusId.textContent()) ?? '';
expect(proteusId).toBeDefined();

return proteusId;
});

await test.step('Log out of public computer', async () => {
Expand Down
Loading