Change default MyObs layout to grid (#2686)

* Change default MyObs layout to grid

* Rename testID

* Update tests expecting to start with list view

* Reverse order of buttons in layout selector

* Fix layout bug of having empty boxes on explore
This commit is contained in:
Johannes Klein
2025-02-21 18:50:14 +01:00
committed by GitHub
parent 002d3615b8
commit bb03bb695a
18 changed files with 115 additions and 117 deletions

View File

@@ -32,8 +32,8 @@ describe( "Signed in user", () => {
// this component becomes visible, and there may be other observations in
// the list, we need to wait for the right CommentsCount component to be
// visible
const obsListItem = element( by.id( /MyObservations\.obsListItem\..*/ ) ).atIndex( 0 );
const obsListItemAttributes = await obsListItem.getAttributes( );
const obsGridItem = element( by.id( /MyObservations\.obsGridItem\..*/ ) ).atIndex( 0 );
const obsListItemAttributes = await obsGridItem.getAttributes( );
const uuid = obsListItemAttributes.elements
? obsListItemAttributes.elements[0].identifier.split( "." ).pop( )
: obsListItemAttributes.identifier.split( "." ).pop( );
@@ -41,7 +41,7 @@ describe( "Signed in user", () => {
if ( options.upload ) {
const commentCount = element(
by.id( "ObsStatus.commentsCount" )
.withAncestor( by.id( `MyObservations.obsListItem.${uuid}` ) )
.withAncestor( by.id( `MyObservations.obsGridItem.${uuid}` ) )
);
await waitFor( commentCount ).toBeVisible().withTimeout( 10000 );
}
@@ -50,8 +50,8 @@ describe( "Signed in user", () => {
}
async function deleteObservationByUUID( uuid, username, options = { uploaded: false } ) {
const obsListItem = element( by.id( `MyObservations.obsListItem.${uuid}` ) );
await obsListItem.tap();
const obsGridItem = element( by.id( `MyObservations.obsGridItem.${uuid}` ) );
await obsGridItem.tap();
await deleteObservation( options );
// Make sure we're back on MyObservations
await waitFor( username ).toBeVisible().withTimeout( 10000 );
@@ -81,8 +81,8 @@ describe( "Signed in user", () => {
/*
/ 4. Update the observation by adding a comment
*/
const obsListItem = element( by.id( `MyObservations.obsListItem.${uuid}` ) );
await obsListItem.tap();
const obsGridItem = element( by.id( `MyObservations.obsGridItem.${uuid}` ) );
await obsGridItem.tap();
const commentButton = element( by.id( "ObsDetail.commentButton" ) );
await waitFor( commentButton ).toBeVisible().withTimeout( 10000 );
await commentButton.tap();
@@ -116,6 +116,6 @@ describe( "Signed in user", () => {
// point, and we can confirm deletion by testing for the absence of the
// list item for the observation we deleted.
await waitFor( element( by.text( /Upload 1 observation/ ) ) ).toBeVisible( ).withTimeout( 20_000 );
await expect( obsListItem ).toBeNotVisible( );
await expect( obsGridItem ).toBeNotVisible( );
} );
} );