Apply prettier formatting
This commit is contained in:
parent
1cac306093
commit
526645c791
1576 changed files with 65385 additions and 62478 deletions
|
@ -25,17 +25,20 @@ describe("Device manager", () => {
|
|||
|
||||
beforeEach(() => {
|
||||
cy.enableLabsFeature("feature_new_device_manager");
|
||||
cy.startSynapse("default").then(data => {
|
||||
cy.startSynapse("default").then((data) => {
|
||||
synapse = data;
|
||||
|
||||
cy.initTestUser(synapse, "Alice").then(credentials => {
|
||||
user = credentials;
|
||||
}).then(() => {
|
||||
// create some extra sessions to manage
|
||||
return cy.loginUser(synapse, user.username, user.password);
|
||||
}).then(() => {
|
||||
return cy.loginUser(synapse, user.username, user.password);
|
||||
});
|
||||
cy.initTestUser(synapse, "Alice")
|
||||
.then((credentials) => {
|
||||
user = credentials;
|
||||
})
|
||||
.then(() => {
|
||||
// create some extra sessions to manage
|
||||
return cy.loginUser(synapse, user.username, user.password);
|
||||
})
|
||||
.then(() => {
|
||||
return cy.loginUser(synapse, user.username, user.password);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -45,72 +48,74 @@ describe("Device manager", () => {
|
|||
|
||||
it("should display sessions", () => {
|
||||
cy.openUserSettings("Sessions");
|
||||
cy.contains('Current session').should('exist');
|
||||
cy.contains("Current session").should("exist");
|
||||
|
||||
cy.get('[data-testid="current-session-section"]').within(() => {
|
||||
cy.contains('Unverified session').should('exist');
|
||||
cy.contains("Unverified session").should("exist");
|
||||
});
|
||||
|
||||
// current session details opened
|
||||
cy.get('[data-testid="current-session-toggle-details"]').click();
|
||||
cy.contains('Session details').should('exist');
|
||||
cy.contains("Session details").should("exist");
|
||||
|
||||
// close current session details
|
||||
cy.get('[data-testid="current-session-toggle-details"]').click();
|
||||
cy.contains('Session details').should('not.exist');
|
||||
cy.contains("Session details").should("not.exist");
|
||||
|
||||
cy.get('[data-testid="security-recommendations-section"]').within(() => {
|
||||
cy.contains('Security recommendations').should('exist');
|
||||
cy.get('[data-testid="unverified-devices-cta"]').should('have.text', 'View all (3)').click();
|
||||
cy.contains("Security recommendations").should("exist");
|
||||
cy.get('[data-testid="unverified-devices-cta"]').should("have.text", "View all (3)").click();
|
||||
});
|
||||
|
||||
/**
|
||||
* Other sessions section
|
||||
*/
|
||||
cy.contains('Other sessions').should('exist');
|
||||
cy.contains("Other sessions").should("exist");
|
||||
// filter applied after clicking through from security recommendations
|
||||
cy.get('[aria-label="Filter devices"]').should('have.text', 'Show: Unverified');
|
||||
cy.get('.mx_FilteredDeviceList_list').find('.mx_FilteredDeviceList_listItem').should('have.length', 3);
|
||||
cy.get('[aria-label="Filter devices"]').should("have.text", "Show: Unverified");
|
||||
cy.get(".mx_FilteredDeviceList_list").find(".mx_FilteredDeviceList_listItem").should("have.length", 3);
|
||||
|
||||
// select two sessions
|
||||
cy.get('.mx_FilteredDeviceList_list .mx_FilteredDeviceList_listItem .mx_Checkbox').first().click();
|
||||
cy.get('.mx_FilteredDeviceList_list .mx_FilteredDeviceList_listItem .mx_Checkbox').last().click();
|
||||
cy.get(".mx_FilteredDeviceList_list .mx_FilteredDeviceList_listItem .mx_Checkbox").first().click();
|
||||
cy.get(".mx_FilteredDeviceList_list .mx_FilteredDeviceList_listItem .mx_Checkbox").last().click();
|
||||
// sign out from list selection action buttons
|
||||
cy.get('[data-testid="sign-out-selection-cta"]').click();
|
||||
cy.get('[data-testid="dialog-primary-button"]').click();
|
||||
// list updated after sign out
|
||||
cy.get('.mx_FilteredDeviceList_list').find('.mx_FilteredDeviceList_listItem').should('have.length', 1);
|
||||
cy.get(".mx_FilteredDeviceList_list").find(".mx_FilteredDeviceList_listItem").should("have.length", 1);
|
||||
// security recommendation count updated
|
||||
cy.get('[data-testid="unverified-devices-cta"]').should('have.text', 'View all (1)');
|
||||
cy.get('[data-testid="unverified-devices-cta"]').should("have.text", "View all (1)");
|
||||
|
||||
const sessionName = `Alice's device`;
|
||||
// open the first session
|
||||
cy.get('.mx_FilteredDeviceList_list .mx_FilteredDeviceList_listItem').first().within(() => {
|
||||
cy.get('[aria-label="Show details"]').click();
|
||||
cy.get(".mx_FilteredDeviceList_list .mx_FilteredDeviceList_listItem")
|
||||
.first()
|
||||
.within(() => {
|
||||
cy.get('[aria-label="Show details"]').click();
|
||||
|
||||
cy.contains('Session details').should('exist');
|
||||
cy.contains("Session details").should("exist");
|
||||
|
||||
cy.get('[data-testid="device-heading-rename-cta"]').click();
|
||||
cy.get('[data-testid="device-rename-input"]').type(sessionName);
|
||||
cy.get('[data-testid="device-rename-submit-cta"]').click();
|
||||
// there should be a spinner while device updates
|
||||
cy.get(".mx_Spinner").should("exist");
|
||||
// wait for spinner to complete
|
||||
cy.get(".mx_Spinner").should("not.exist");
|
||||
cy.get('[data-testid="device-heading-rename-cta"]').click();
|
||||
cy.get('[data-testid="device-rename-input"]').type(sessionName);
|
||||
cy.get('[data-testid="device-rename-submit-cta"]').click();
|
||||
// there should be a spinner while device updates
|
||||
cy.get(".mx_Spinner").should("exist");
|
||||
// wait for spinner to complete
|
||||
cy.get(".mx_Spinner").should("not.exist");
|
||||
|
||||
// session name updated in details
|
||||
cy.get('.mx_DeviceDetailHeading h3').should('have.text', sessionName);
|
||||
// and main list item
|
||||
cy.get('.mx_DeviceTile h4').should('have.text', sessionName);
|
||||
// session name updated in details
|
||||
cy.get(".mx_DeviceDetailHeading h3").should("have.text", sessionName);
|
||||
// and main list item
|
||||
cy.get(".mx_DeviceTile h4").should("have.text", sessionName);
|
||||
|
||||
// sign out using the device details sign out
|
||||
cy.get('[data-testid="device-detail-sign-out-cta"]').click();
|
||||
});
|
||||
// sign out using the device details sign out
|
||||
cy.get('[data-testid="device-detail-sign-out-cta"]').click();
|
||||
});
|
||||
// confirm the signout
|
||||
cy.get('[data-testid="dialog-primary-button"]').click();
|
||||
|
||||
// no other sessions or security recommendations sections when only one session
|
||||
cy.contains('Other sessions').should('not.exist');
|
||||
cy.get('[data-testid="security-recommendations-section"]').should('not.exist');
|
||||
cy.contains("Other sessions").should("not.exist");
|
||||
cy.get('[data-testid="security-recommendations-section"]').should("not.exist");
|
||||
});
|
||||
});
|
||||
|
|
|
@ -21,7 +21,7 @@ import { SynapseInstance } from "../../plugins/synapsedocker";
|
|||
function seedLabs(synapse: SynapseInstance, labsVal: boolean | null): void {
|
||||
cy.initTestUser(synapse, "Sally", () => {
|
||||
// seed labs flag
|
||||
cy.window({ log: false }).then(win => {
|
||||
cy.window({ log: false }).then((win) => {
|
||||
if (typeof labsVal === "boolean") {
|
||||
// stringify boolean
|
||||
win.localStorage.setItem("mx_labs_feature_feature_hidden_read_receipts", `${labsVal}`);
|
||||
|
@ -64,7 +64,7 @@ describe("Hidden Read Receipts Setting Migration", () => {
|
|||
let synapse: SynapseInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
cy.startSynapse("default").then(data => {
|
||||
cy.startSynapse("default").then((data) => {
|
||||
synapse = data;
|
||||
});
|
||||
});
|
||||
|
@ -73,17 +73,17 @@ describe("Hidden Read Receipts Setting Migration", () => {
|
|||
cy.stopSynapse(synapse);
|
||||
});
|
||||
|
||||
it('should not migrate the lack of a labs flag', () => {
|
||||
it("should not migrate the lack of a labs flag", () => {
|
||||
seedLabs(synapse, null);
|
||||
testForVal(null);
|
||||
});
|
||||
|
||||
it('should migrate labsHiddenRR=false as sendRR=true', () => {
|
||||
it("should migrate labsHiddenRR=false as sendRR=true", () => {
|
||||
seedLabs(synapse, false);
|
||||
testForVal(true);
|
||||
});
|
||||
|
||||
it('should migrate labsHiddenRR=true as sendRR=false', () => {
|
||||
it("should migrate labsHiddenRR=true as sendRR=false", () => {
|
||||
seedLabs(synapse, true);
|
||||
testForVal(false);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue