mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-19 17:01:13 +00:00
Show system partition key value and add test cases
This commit is contained in:
@@ -50,10 +50,6 @@ for (const { name, databaseId, containerId, documents } of documentTestCases) {
|
||||
let newDocumentId;
|
||||
await page.waitForTimeout(5000);
|
||||
await retry(async () => {
|
||||
// const discardButton = await explorer.waitForCommandBarButton("Discard", 5000);
|
||||
// if (await discardButton.isEnabled()) {
|
||||
// await discardButton.click();
|
||||
// }
|
||||
const newDocumentButton = await explorer.waitForCommandBarButton("New Item", 5000);
|
||||
await expect(newDocumentButton).toBeVisible();
|
||||
await expect(newDocumentButton).toBeEnabled();
|
||||
@@ -71,10 +67,15 @@ for (const { name, databaseId, containerId, documents } of documentTestCases) {
|
||||
await documentsTab.resultsEditor.setText(JSON.stringify(newDocument));
|
||||
const saveButton = await explorer.waitForCommandBarButton("Save", 5000);
|
||||
await saveButton.click({ timeout: 5000 });
|
||||
await expect(saveButton).toBeHidden({ timeout: 5000 });
|
||||
}, 3);
|
||||
|
||||
await documentsTab.setFilter(`WHERE c.id = "${newDocumentId}"`);
|
||||
await documentsTab.filterButton.click();
|
||||
|
||||
const newSpan = documentsTab.documentsListPane.getByText(newDocumentId, { exact: true }).nth(0);
|
||||
await newSpan.waitFor();
|
||||
|
||||
await newSpan.click();
|
||||
await expect(documentsTab.resultsEditor.locator).toBeAttached({ timeout: 60 * 1000 });
|
||||
|
||||
|
||||
@@ -5,7 +5,24 @@ export const documentTestCases: DocumentTestCase[] = [
|
||||
name: "System Partition Key",
|
||||
databaseId: "e2etests-sql-readonly",
|
||||
containerId: "systemPartitionKey",
|
||||
documents: [{ documentId: "systempartition", partitionKeys: [] }],
|
||||
documents: [
|
||||
{
|
||||
documentId: "systempartition",
|
||||
partitionKeys: [{ key: "/_partitionKey", value: "partitionKey" }],
|
||||
skipCreateDelete: true,
|
||||
},
|
||||
{
|
||||
documentId: "systempartition_empty",
|
||||
partitionKeys: [{ key: "/_partitionKey", value: "" }],
|
||||
skipCreateDelete: true,
|
||||
},
|
||||
{
|
||||
documentId: "systempartition_null",
|
||||
partitionKeys: [{ key: "/_partitionKey", value: null }],
|
||||
skipCreateDelete: true,
|
||||
},
|
||||
{ documentId: "systempartition_missing", partitionKeys: [] },
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Single Partition Key",
|
||||
|
||||
Reference in New Issue
Block a user