diff --git a/packages/compass-crud/src/stores/crud-store.spec.ts b/packages/compass-crud/src/stores/crud-store.spec.ts index 2b1c47ac349..626340340ed 100644 --- a/packages/compass-crud/src/stores/crud-store.spec.ts +++ b/packages/compass-crud/src/stores/crud-store.spec.ts @@ -285,7 +285,7 @@ describe('store', function () { debouncingLoad: false, loadingCount: false, collection: 'test', - count: 0, + count: null, docs: [], docsPerPage: 25, end: 0, @@ -1170,6 +1170,7 @@ describe('store', function () { store.state.insert.jsonView = true; store.state.insert.doc = hadronDoc; store.state.insert.jsonDoc = jsonDoc; + store.state.count = 0; }); it('does not insert the document and sets the error', async function () { @@ -1202,6 +1203,7 @@ describe('store', function () { store.state.insert.jsonView = true; store.state.insert.doc = hadronDoc; store.state.insert.jsonDoc = jsonDoc; + store.state.count = 0; }); afterEach(function () { @@ -1233,6 +1235,7 @@ describe('store', function () { beforeEach(function () { store.state.insert.doc = doc; store.state.insert.jsonDoc = jsonDoc; + store.state.count = 0; }); afterEach(function () { @@ -1267,6 +1270,7 @@ describe('store', function () { store.state.insert.jsonView = true; store.state.insert.doc = hadronDoc; store.state.insert.jsonDoc = jsonDoc; + store.state.count = 0; }); afterEach(async function () { @@ -1425,6 +1429,7 @@ describe('store', function () { beforeEach(function () { store.state.insert.jsonDoc = JSON.stringify(docs); + store.state.count = 0; }); afterEach(function () { diff --git a/packages/compass-crud/src/stores/crud-store.ts b/packages/compass-crud/src/stores/crud-store.ts index 41857262dec..006bbfae4c9 100644 --- a/packages/compass-crud/src/stores/crud-store.ts +++ b/packages/compass-crud/src/stores/crud-store.ts @@ -426,7 +426,7 @@ class CrudStoreImpl end: 0, page: 0, view: LIST, - count: 0, + count: null, insert: this.getInitialInsertState(), bulkUpdate: this.getInitialBulkUpdateState(), bulkDelete: this.getInitialBulkDeleteState(), @@ -1913,7 +1913,7 @@ class CrudStoreImpl const confirmation = await showConfirmation({ title: 'Are you absolutely sure?', - buttonText: `Delete ${affected || 0} document${ + buttonText: `Delete ${affected ? `${affected} ` : ''} document${ affected !== 1 ? 's' : '' }`, description: `This action can not be undone. This will permanently delete ${