You've already forked matrix-react-sdk
							
							
				mirror of
				https://github.com/matrix-org/matrix-react-sdk.git
				synced 2025-11-03 00:33:22 +03:00 
			
		
		
		
	Update location.spec.ts - use Cypress Testing Library (#10612)
				
					
				
			* Update location.spec.ts - use Cypress Testing Library Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com> * Make the test id of location share option discoverable with findByTestId() findByTestId seeks for data-testid, instead of data-test-id. Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com> --------- Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
This commit is contained in:
		@@ -23,11 +23,11 @@ describe("Location sharing", () => {
 | 
				
			|||||||
    let homeserver: HomeserverInstance;
 | 
					    let homeserver: HomeserverInstance;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const selectLocationShareTypeOption = (shareType: string): Chainable<JQuery> => {
 | 
					    const selectLocationShareTypeOption = (shareType: string): Chainable<JQuery> => {
 | 
				
			||||||
        return cy.get(`[data-testid="share-location-option-${shareType}"]`);
 | 
					        return cy.findByTestId(`share-location-option-${shareType}`);
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const submitShareLocation = (): void => {
 | 
					    const submitShareLocation = (): void => {
 | 
				
			||||||
        cy.get('[data-testid="location-picker-submit-button"]').click();
 | 
					        cy.findByRole("button", { name: "Share location" }).click();
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    beforeEach(() => {
 | 
					    beforeEach(() => {
 | 
				
			||||||
@@ -53,7 +53,7 @@ describe("Location sharing", () => {
 | 
				
			|||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        cy.openMessageComposerOptions().within(() => {
 | 
					        cy.openMessageComposerOptions().within(() => {
 | 
				
			||||||
            cy.get('[aria-label="Location"]').click();
 | 
					            cy.findByRole("menuitem", { name: "Location" }).click();
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        selectLocationShareTypeOption("Pin").click();
 | 
					        selectLocationShareTypeOption("Pin").click();
 | 
				
			||||||
@@ -67,7 +67,7 @@ describe("Location sharing", () => {
 | 
				
			|||||||
        // clicking location tile opens maximised map
 | 
					        // clicking location tile opens maximised map
 | 
				
			||||||
        cy.get(".mx_LocationViewDialog_wrapper").should("exist");
 | 
					        cy.get(".mx_LocationViewDialog_wrapper").should("exist");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        cy.get('[aria-label="Close dialog"]').click();
 | 
					        cy.closeDialog();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        cy.get(".mx_Marker").should("exist");
 | 
					        cy.get(".mx_Marker").should("exist");
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user