Skip to content

Commit 89d78a9

Browse files
committed
call all to.throw
1 parent 8b51aeb commit 89d78a9

File tree

49 files changed

+141
-133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+141
-133
lines changed

packages/compass-aggregations/src/components/add-stage/add-stage.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe('AddStage', function () {
2424
const button = screen.getByTestId('add-stage-icon-button');
2525
expect(() => {
2626
within(button).getByText('Add stage');
27-
}).to.throw;
27+
}).to.throw();
2828
});
2929

3030
it('calls onAddStage with index when clicked', function () {

packages/compass-aggregations/src/components/aggregation-side-panel/index.spec.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ describe('aggregation side panel', function () {
5050

5151
it('renders a search input', async function () {
5252
await renderAggregationSidePanel();
53-
expect(screen.getByRole('search')).to.not.throw;
53+
expect(() => screen.getByRole('search')).to.not.throw();
5454
});
5555

5656
it('renders all the usecases', async function () {
@@ -71,7 +71,7 @@ describe('aggregation side panel', function () {
7171
.getByTestId('side-panel-content')
7272
.querySelectorAll('[data-testid^="use-case-"]')
7373
).to.have.lengthOf(1);
74-
expect(screen.getByTestId('use-case-sort')).to.not.throw;
74+
expect(() => screen.getByTestId('use-case-sort')).to.not.throw();
7575
});
7676

7777
it('renders usecases filtered by search text matching the stage operator of the usecases', async function () {
@@ -83,7 +83,7 @@ describe('aggregation side panel', function () {
8383
.getByTestId('side-panel-content')
8484
.querySelectorAll('[data-testid^="use-case-"]')
8585
).to.have.lengthOf(1);
86-
expect(screen.getByTestId('use-case-lookup')).to.not.throw;
86+
expect(() => screen.getByTestId('use-case-lookup')).to.not.throw();
8787

8888
userEvent.clear(searchBox);
8989
userEvent.type(searchBox, '$lookup');
@@ -92,7 +92,7 @@ describe('aggregation side panel', function () {
9292
.getByTestId('side-panel-content')
9393
.querySelectorAll('[data-testid^="use-case-"]')
9494
).to.have.lengthOf(1);
95-
expect(screen.getByTestId('use-case-lookup')).to.not.throw;
95+
expect(() => screen.getByTestId('use-case-lookup')).to.not.throw();
9696
});
9797

9898
it('calls onSelectUseCase when a use case is clicked', async function () {

packages/compass-aggregations/src/components/aggregation-side-panel/stage-wizard-use-cases/group/group-with-subset.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ describe('group with subset', function () {
103103
);
104104
});
105105
it('renders number of records input', function () {
106-
expect(screen.getByTestId('number-of-records-input')).to.throw;
106+
expect(() => screen.getByTestId('number-of-records-input')).to.throw();
107107
});
108108
});
109109

packages/compass-aggregations/src/components/aggregation-side-panel/stage-wizard-use-cases/match/match-group-form.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ describe('group', function () {
104104
).to.exist;
105105
expect(() =>
106106
screen.getByTestId(TEST_IDS.removeGroupBtn(group.id))
107-
).to.throw;
107+
).to.throw();
108108
});
109109
});
110110

packages/compass-aggregations/src/components/aggregation-side-panel/stage-wizard-use-cases/use-case-card.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe('UseCaseCard', function () {
2323
onSelect={Sinon.spy()}
2424
/>
2525
);
26-
expect(screen.getByTestId(`use-case-${useCase.id}`)).to.not.throw;
26+
expect(() => screen.getByTestId(`use-case-${useCase.id}`)).to.not.throw();
2727
});
2828

2929
it('should call onSelect when a usecase is selected', function () {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ describe('FocusMode', function () {
2222
await renderFocusModeStageEditor({ index: -1 });
2323
expect(() => {
2424
screen.getByTestId('stage-operator-combobox');
25-
}).to.throw;
25+
}).to.throw();
2626
expect(() => {
2727
screen.getByText(/open docs/i);
28-
}).to.throw;
28+
}).to.throw();
2929
});
3030

3131
context('when operator is not defined', function () {
@@ -44,7 +44,7 @@ describe('FocusMode', function () {
4444
it('does not render docs link', function () {
4545
expect(() => {
4646
screen.getByText(/open docs/i);
47-
}).to.throw;
47+
}).to.throw();
4848
});
4949
});
5050

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('FocusMode', function () {
2222
await waitFor(() => {
2323
expect(() => {
2424
screen.getByTestId('focus-mode-modal');
25-
}).to.throw;
25+
}).to.throw();
2626
});
2727
});
2828

@@ -44,6 +44,6 @@ describe('FocusMode', function () {
4444

4545
expect(() => {
4646
screen.getByTestId('focus-mode-modal');
47-
}).to.throw;
47+
}).to.throw();
4848
});
4949
});

packages/compass-aggregations/src/components/pipeline-builder-workspace/index.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe('PipelineBuilderWorkspace', function () {
3838
const container = screen.getByTestId('pipeline-builder-workspace');
3939
expect(() => {
4040
within(container).getByTestId('aggregation-side-panel');
41-
}).to.not.throw;
41+
}).to.not.throw();
4242
});
4343

4444
it('does not render side panel when enabled in as text mode', async function () {
@@ -47,6 +47,6 @@ describe('PipelineBuilderWorkspace', function () {
4747
const container = screen.getByTestId('pipeline-builder-workspace');
4848
expect(() => {
4949
within(container).getByTestId('aggregation-side-panel');
50-
}).to.throw;
50+
}).to.throw();
5151
});
5252
});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ describe('PipelineAsTextWorkspace', function () {
2626
await renderPipelineAsTextWorkspace({ isAutoPreview: false });
2727
expect(() => {
2828
screen.getByTestId('pipeline-as-text-preview');
29-
}).to.throw;
29+
}).to.throw();
3030
});
3131
});

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ describe('PipelinePreview', function () {
113113
// By default we don't expand nested props of a document
114114
expect(within(docList).getByText(/_id/)).to.exist;
115115
expect(within(docList).getByText(/score/)).to.exist;
116-
expect(() => within(docList).getByText(/number/)).to.throw;
117-
expect(() => within(docList).getByText(/another/)).to.throw;
118-
expect(() => within(docList).getByText(/deep/)).to.throw;
119-
expect(() => within(docList).getByText(/nested/)).to.throw;
120-
expect(() => within(docList).getByText(/document/)).to.throw;
116+
expect(() => within(docList).getByText(/number/)).to.throw();
117+
expect(() => within(docList).getByText(/another/)).to.throw();
118+
expect(() => within(docList).getByText(/deep/)).to.throw();
119+
expect(() => within(docList).getByText(/nested/)).to.throw();
120+
expect(() => within(docList).getByText(/document/)).to.throw();
121121

122122
// Expand the whole document
123123
userEvent.click(
@@ -153,11 +153,11 @@ describe('PipelinePreview', function () {
153153

154154
expect(within(docList).getByText(/_id/)).to.exist;
155155
expect(within(docList).getByText(/score/)).to.exist;
156-
expect(() => within(docList).getByText(/number/)).to.throw;
157-
expect(() => within(docList).getByText(/another/)).to.throw;
158-
expect(() => within(docList).getByText(/deep/)).to.throw;
159-
expect(() => within(docList).getByText(/nested/)).to.throw;
160-
expect(() => within(docList).getByText(/document/)).to.throw;
156+
expect(() => within(docList).getByText(/number/)).to.throw();
157+
expect(() => within(docList).getByText(/another/)).to.throw();
158+
expect(() => within(docList).getByText(/deep/)).to.throw();
159+
expect(() => within(docList).getByText(/nested/)).to.throw();
160+
expect(() => within(docList).getByText(/document/)).to.throw();
161161
});
162162

163163
it('renders output stage preview', async function () {

0 commit comments

Comments
 (0)