Skip to content

Commit 50fa4bc

Browse files
committed
tests
1 parent f98baa8 commit 50fa4bc

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

packages/compass-aggregations/src/components/focus-mode/focus-mode-stage-preview.spec.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,18 @@ describe('FocusModeStagePreview', function () {
8686
const preview = screen.getByTestId('focus-mode-stage-preview');
8787
expect(within(preview).getByText(/no preview documents/i)).to.exist;
8888
});
89+
it('renders missing search index text for $search', async function () {
90+
await renderFocusModePreview({
91+
stageOperator: '$search',
92+
documents: [],
93+
});
94+
expect(screen.getByText('No preview documents')).to.exist;
95+
expect(
96+
screen.getByText(
97+
'This may be because your search has no results or your search index does not exist.'
98+
)
99+
).to.exist;
100+
});
89101
it('renders $out stage preview', async function () {
90102
await renderFocusModePreview(
91103
{

packages/compass-aggregations/src/components/pipeline-builder-workspace/pipeline-as-text-workspace/pipeline-preview.spec.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,19 @@ describe('PipelinePreview', function () {
5555
expect(screen.getByText(/No preview documents/)).to.exist;
5656
});
5757

58+
it('renders missing search index text for $search', async function () {
59+
await renderPipelineEditor({
60+
atlasOperator: '$search',
61+
previewDocs: [],
62+
});
63+
expect(screen.getByText('No preview documents')).to.exist;
64+
expect(
65+
screen.getByText(
66+
'This may be because your search has no results or your search index does not exist.'
67+
)
68+
).to.exist;
69+
});
70+
5871
it('renders document list', async function () {
5972
await renderPipelineEditor({
6073
previewDocs: [{ _id: 1 }, { _id: 2 }].map(

packages/compass-aggregations/src/components/stage-preview/index.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ describe('StagePreview', function () {
106106
stageOperator: '$search',
107107
documents: [],
108108
});
109-
expect(screen.getByText('No results found')).to.exist;
109+
expect(screen.getByText('No preview documents')).to.exist;
110110
expect(
111111
screen.getByText(
112112
'This may be because your search has no results or your search index does not exist.'

0 commit comments

Comments
 (0)