Skip to content

Commit 7af999a

Browse files
committed
fixup: aggregation test
1 parent d0ba6c7 commit 7af999a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

packages/compass-e2e-tests/tests/atlas-cloud/collection-ai-query.test.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ describe('Collection ai query', function () {
119119
// Click generate.
120120
await browser.clickVisible(Selectors.GenAIGenerateQueryButton);
121121

122-
// Wait for the ipc events to succeed.
123122
await browser.waitUntil(async function () {
124-
const textContent = browser.$(Selectors.AggregationAsTextEditor);
125-
expect(await textContent.getText()).to.contain('$match');
123+
const textEditor = browser.$(Selectors.AggregationAsTextEditor);
124+
const textContent = await textEditor.getText();
125+
return textContent.includes('$match');
126126
});
127127

128128
// Run it and check that the correct documents are shown.
@@ -135,9 +135,12 @@ describe('Collection ai query', function () {
135135
await browser.clickVisible(
136136
Selectors.AggregationResultsJSONListSwitchButton
137137
);
138-
const documents = await browser.getCodemirrorEditorTextAll(
138+
const rawDocuments = await browser.getCodemirrorEditorTextAll(
139139
Selectors.DocumentJSONEntry
140140
);
141+
const documents = rawDocuments.map((text) => {
142+
return JSON.parse(text);
143+
});
141144

142145
expect(documents).to.have.lengthOf(1);
143146
expect(documents[0]).to.have.property('_id');

0 commit comments

Comments
 (0)