Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -1005,6 +1005,7 @@ class DocumentTableView extends React.Component<DocumentTableViewProps> {
'document-table-view-container',
this.props.darkMode && 'document-table-view-container-darkmode'
)}
data-testid="document-list"
>
<div className={cx('ag-parent', this.props.className)}>
<BreadcrumbComponent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ const VirtualizedDocumentJsonView: React.FC<
renderItem={renderItem}
estimateItemInitialHeight={estimateDocumentInitialHeight}
rowGap={spacing[200]}
dataTestId="document-list"
itemDataTestId="document-json-item"
// Keeping the overscanCount low here helps us avoid scroll dangling
// issues
Expand Down
11 changes: 11 additions & 0 deletions packages/compass-e2e-tests/helpers/commands/run-find.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,16 @@ export async function runFind(
const resultId = await browser.getQueryId(tabName);
return resultId !== initialResultId;
});

// Wait for animations to finish on the documents or schema page.
// Because we're virtualizing the list on crud, the query results may
// change after the resultId has changed.
if (tabName === 'Documents') {
await browser.waitForAnimations(Selectors.DocumentList);
} else if (tabName === 'Schema') {
/* not virtualized */
} else {
throw new Error(`Unknown tab name ${tabName}`);
}
}
}
1 change: 1 addition & 0 deletions packages/compass-e2e-tests/helpers/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ export const ImportFileOption =
export const DocumentListEntry = '[data-testid="editable-document"]';
export const DocumentJSONEntry = '[data-testid="document-json-item"]';
export const DocumentExpandButton = '[data-testid="expand-document-button"]';
export const DocumentList = '[data-testid="document-list"]';
export const SelectJSONView = '[data-testid="toolbar-view-json"]';
export const SelectTableView = '[data-testid="toolbar-view-table"]';
export const SelectListView = '[data-testid="toolbar-view-list"]';
Expand Down
Loading