Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/compass-crud/src/stores/crud-store.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ describe('store', function () {
debouncingLoad: false,
loadingCount: false,
collection: 'test',
count: 0,
count: null,
docs: [],
docsPerPage: 25,
end: 0,
Expand Down Expand Up @@ -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 () {
Expand Down Expand Up @@ -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 () {
Expand Down Expand Up @@ -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 () {
Expand Down Expand Up @@ -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 () {
Expand Down Expand Up @@ -1425,6 +1429,7 @@ describe('store', function () {

beforeEach(function () {
store.state.insert.jsonDoc = JSON.stringify(docs);
store.state.count = 0;
});

afterEach(function () {
Expand Down
4 changes: 2 additions & 2 deletions packages/compass-crud/src/stores/crud-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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 ${
Expand Down
Loading