mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-04-29 21:14:32 +01:00
Fix unit tests
This commit is contained in:
parent
c9398e303b
commit
a2556dad06
@ -486,7 +486,7 @@ export const buildQuery = (
|
|||||||
filter,
|
filter,
|
||||||
partitionKeyProperties,
|
partitionKeyProperties,
|
||||||
partitionKey,
|
partitionKey,
|
||||||
additionalField.filter((f) => !f.startsWith("/")),
|
additionalField?.filter((f) => !f.startsWith("/")) || [],
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -987,15 +987,15 @@ export const DocumentsTabComponent: React.FunctionComponent<IDocumentsTabCompone
|
|||||||
const deletePromise = !isPreferredApiMongoDB
|
const deletePromise = !isPreferredApiMongoDB
|
||||||
? _deleteNoSqlDocuments(_collection, toDeleteDocumentIds)
|
? _deleteNoSqlDocuments(_collection, toDeleteDocumentIds)
|
||||||
: MongoProxyClient.deleteDocuments(
|
: MongoProxyClient.deleteDocuments(
|
||||||
_collection.databaseId,
|
_collection.databaseId,
|
||||||
_collection as ViewModels.Collection,
|
_collection as ViewModels.Collection,
|
||||||
toDeleteDocumentIds,
|
toDeleteDocumentIds,
|
||||||
).then(({ deletedCount, isAcknowledged }) => {
|
).then(({ deletedCount, isAcknowledged }) => {
|
||||||
if (deletedCount === toDeleteDocumentIds.length && isAcknowledged) {
|
if (deletedCount === toDeleteDocumentIds.length && isAcknowledged) {
|
||||||
return toDeleteDocumentIds;
|
return toDeleteDocumentIds;
|
||||||
}
|
}
|
||||||
throw new Error(`Delete failed with deletedCount: ${deletedCount} and isAcknowledged: ${isAcknowledged}`);
|
throw new Error(`Delete failed with deletedCount: ${deletedCount} and isAcknowledged: ${isAcknowledged}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
return deletePromise
|
return deletePromise
|
||||||
.then(
|
.then(
|
||||||
@ -1068,8 +1068,8 @@ export const DocumentsTabComponent: React.FunctionComponent<IDocumentsTabCompone
|
|||||||
? `the selected ${selectedRows.size} items`
|
? `the selected ${selectedRows.size} items`
|
||||||
: "the selected item"
|
: "the selected item"
|
||||||
: isPlural
|
: isPlural
|
||||||
? `the selected ${selectedRows.size} documents`
|
? `the selected ${selectedRows.size} documents`
|
||||||
: "the selected document";
|
: "the selected document";
|
||||||
const msg = `Are you sure you want to delete ${documentName}?`;
|
const msg = `Are you sure you want to delete ${documentName}?`;
|
||||||
|
|
||||||
useDialog
|
useDialog
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user