Skip to content

Commit

Permalink
fix(query-bar, schema): double space not applied from schema or query…
Browse files Browse the repository at this point in the history
… history COMPASS-6980 (#5471)
  • Loading branch information
Anemy authored Feb 21, 2024
1 parent 27cd80c commit 83ae812
Show file tree
Hide file tree
Showing 18 changed files with 68 additions and 56 deletions.
44 changes: 22 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/compass-aggregations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"mongodb-database-model": "^2.17.4",
"mongodb-instance-model": "^12.17.4",
"mongodb-ns": "^2.4.0",
"mongodb-query-parser": "^4.0.2",
"mongodb-query-parser": "^4.1.0",
"mongodb-schema": "^12.1.0",
"nyc": "^15.1.0",
"prettier": "^2.7.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ describe('match', function () {
const onChangeSpy = Sinon.spy();
render(<MatchForm fields={SAMPLE_FIELDS} onChange={onChangeSpy} />);
setComboboxValue(new RegExp(SINGLE_SELECT_LABEL, 'i'), 'name');
expect(onChangeSpy.lastCall.args).deep.equal(["{\n name: ''\n}", null]);
expect(onChangeSpy.lastCall.args).deep.equal(["{\n name: ''\n}", null]);
});

it('should call onChange with an error if there was an error during the conversion to stage', function () {
Expand Down
2 changes: 1 addition & 1 deletion packages/compass-crud/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"mocha": "^10.2.0",
"mongodb-instance-model": "^12.17.4",
"mongodb-ns": "^2.4.0",
"mongodb-query-parser": "^4.0.2",
"mongodb-query-parser": "^4.1.0",
"nyc": "^15.1.0",
"prop-types": "^15.7.2",
"react": "^17.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('BulkDeleteModal Component', function () {
it('shows the provided query', function () {
renderBulkDeleteModal({ filter: { a: 1 } });
expect(screen.getByTestId('readonly-filter').textContent).to.equal(
'{\n a: 1\n}'
'{\n a: 1\n}'
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('BulkUpdateModal Component', function () {

// filter
expect(screen.getByTestId('readonly-filter').textContent).to.equal(
'{\n a: 1\n}'
'{\n a: 1\n}'
);

// update
Expand Down
2 changes: 1 addition & 1 deletion packages/compass-crud/src/stores/crud-store.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ describe('store', function () {
'open-query-export-to-language',
(options, exportMode) => {
expect(exportMode).to.equal('Delete Query');
expect(options).to.deep.equal({ filter: '{\n query: 1\n}' });
expect(options).to.deep.equal({ filter: '{\n query: 1\n}' });

done();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ describe('Collection documents tab', function () {
});

const queries = await getRecentQueries(browser, true);
expect(queries).to.deep.include.members([{ Filter: '{\n i: 5\n}' }]);
expect(queries).to.deep.include.members([{ Filter: '{\n i: 5\n}' }]);
});

it('supports advanced find operations', async function () {
Expand Down Expand Up @@ -197,11 +197,11 @@ describe('Collection documents tab', function () {
const queries = await getRecentQueries(browser, true);
expect(queries).to.deep.include.members([
{
Filter: '{\n i: {\n $gt: 5\n }\n}',
Filter: '{\n i: {\n $gt: 5\n }\n}',
Limit: '50',
Project: '{\n _id: 0\n}',
Project: '{\n _id: 0\n}',
Skip: '5',
Sort: '{\n i: -1\n}',
Sort: '{\n i: -1\n}',
},
]);
});
Expand Down Expand Up @@ -244,7 +244,7 @@ describe('Collection documents tab', function () {
const queries = await getRecentQueries(browser, true);
expect(queries).to.deep.include.members([
{
Filter: "{\n $where: 'function() { return sleep(10000) || true; }'\n}",
Filter: "{\n $where: 'function() { return sleep(10000) || true; }'\n}",
},
]);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/compass-import-export/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"mocha": "^10.2.0",
"mongodb": "^6.3.0",
"mongodb-ns": "^2.4.0",
"mongodb-query-parser": "^4.0.2",
"mongodb-query-parser": "^4.1.0",
"mongodb-schema": "^12.1.0",
"nyc": "^15.1.0",
"papaparse": "^5.3.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/compass-indexes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"lodash": "^4.17.21",
"mocha": "^10.2.0",
"mongodb": "^6.3.0",
"mongodb-query-parser": "^4.0.2",
"mongodb-query-parser": "^4.1.0",
"numeral": "^2.0.6",
"nyc": "^15.1.0",
"react": "^17.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/compass-query-bar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"mongodb": "^6.3.0",
"mongodb-instance-model": "^12.17.4",
"mongodb-ns": "^2.4.0",
"mongodb-query-parser": "^4.0.2",
"mongodb-query-parser": "^4.1.0",
"mongodb-schema": "^12.1.0",
"nyc": "^15.1.0",
"react": "^17.0.2",
Expand Down
10 changes: 5 additions & 5 deletions packages/compass-query-bar/src/stores/query-bar-reducer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ describe('queryBarReducer', function () {
expect(getField('filter'))
.to.have.property('value')
.deep.eq({ _id: '123' });
expect(getField('filter')).to.have.property('string', "{_id: '123'}");
expect(getField('filter')).to.have.property('string', '{ _id: "123" }');
expect(getField('filter')).to.have.property('valid', true);

expect(getField('project')).to.have.property('value').deep.eq({ _id: 1 });
expect(getField('project')).to.have.property('string', '{_id: 1}');
expect(getField('project')).to.have.property('string', '{ _id: 1 }');
expect(getField('project')).to.have.property('valid', true);

expect(getField('sort')).to.have.property('value').deep.eq({ _id: -1 });
expect(getField('sort')).to.have.property('string', '{_id: -1}');
expect(getField('sort')).to.have.property('string', '{ _id: -1 }');
expect(getField('sort')).to.have.property('valid', true);

expect(getField('skip')).to.have.property(
Expand Down Expand Up @@ -217,15 +217,15 @@ describe('queryBarReducer', function () {
.deep.eq(newQuery.filter);
expect(store.getState().queryBar).to.have.nested.property(
'fields.filter.string',
'{_id: 2}'
'{ _id: 2 }'
);

expect(store.getState().queryBar)
.to.have.nested.property('fields.sort.value')
.deep.eq(newQuery.sort);
expect(store.getState().queryBar).to.have.nested.property(
'fields.sort.string',
'{_id: -1}'
'{ _id: -1 }'
);
});
});
Expand Down
Loading

0 comments on commit 83ae812

Please sign in to comment.