Device manager - device security recommendation card (PSG-637) (#9158)
* add security card and style * deprecate warning and verified svgs that use hard coded color * style icons, test * i18n * stylelint * redo lost lint fixes * fix svg ref * actually fix svg * fix stupid copy pasting * use rgba for e2e light variations * add security card and style * deprecate warning and verified svgs that use hard coded color * style icons, test * i18n * stylelint * fix svg ref * actually fix svg * fix stupid copy pasting * use rgba for e2e light variations * use device security card in current session section * lint * update snapshot test after dev merge
This commit is contained in:
parent
0be622e7f0
commit
7b52145461
18 changed files with 401 additions and 11 deletions
|
@ -143,7 +143,7 @@ describe('<SessionManagerTab />', () => {
|
|||
expect(getByTestId(`device-tile-${alicesDevice.device_id}`)).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('renders current session section', async () => {
|
||||
it('renders current session section with an unverified session', async () => {
|
||||
mockClient.getDevices.mockResolvedValue({ devices: [alicesDevice, alicesMobileDevice] });
|
||||
const { getByTestId } = render(getComponent());
|
||||
|
||||
|
@ -154,6 +154,21 @@ describe('<SessionManagerTab />', () => {
|
|||
expect(getByTestId('current-session-section')).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('renders current session section with a verified session', async () => {
|
||||
mockClient.getDevices.mockResolvedValue({ devices: [alicesDevice, alicesMobileDevice] });
|
||||
mockClient.getStoredDevice.mockImplementation(() => new DeviceInfo(alicesDevice.device_id));
|
||||
mockCrossSigningInfo.checkDeviceTrust
|
||||
.mockReturnValue(new DeviceTrustLevel(true, true, false, false));
|
||||
|
||||
const { getByTestId } = render(getComponent());
|
||||
|
||||
await act(async () => {
|
||||
await flushPromisesWithFakeTimers();
|
||||
});
|
||||
|
||||
expect(getByTestId('current-session-section')).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('does not render other sessions section when user has only one device', async () => {
|
||||
mockClient.getDevices.mockResolvedValue({ devices: [alicesDevice] });
|
||||
const { queryByTestId } = render(getComponent());
|
||||
|
@ -165,7 +180,7 @@ describe('<SessionManagerTab />', () => {
|
|||
expect(queryByTestId('other-sessions-section')).toBeFalsy();
|
||||
});
|
||||
|
||||
it('renders other sessions section', async () => {
|
||||
it('renders other sessions section when user has more than one device', async () => {
|
||||
mockClient.getDevices.mockResolvedValue({
|
||||
devices: [alicesDevice, alicesOlderMobileDevice, alicesMobileDevice],
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue