Skip to content

Commit 0689c02

Browse files
authored
Don't refresh documents every time we switch views (COMPASS-5236) (#2550)
* don't refresh documents every time we switch views * hopefully more useful test failures if it fails again
1 parent 9d8e976 commit 0689c02

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/compass-crud/src/components/toolbar.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ class Toolbar extends React.Component {
4646
*/
4747
switchDocumentView(view) {
4848
this.props.viewSwitchHandler(view);
49-
this.props.refreshDocuments();
5049
}
5150

5251
_loadedMessage() {

packages/compass-crud/src/stores/crud-store.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,8 @@ describe('store', function() {
464464
it('updates the document in the list', (done) => {
465465
const unsubscribe = store.listen((state) => {
466466
expect(state.docs[0]).to.not.equal(hadronDoc);
467-
expect(state.docs[0].elements.at(2).key === 'new field');
467+
expect(state.docs[0]).to.have.property('elements');
468+
expect(state.docs[0].elements.at(2).key).to.equal('new field');
468469
unsubscribe();
469470
// Ensure we have enough time for update-blocked or update-error to be called.
470471
setTimeout(() => done(), 100);

0 commit comments

Comments
 (0)