mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-27 21:54:15 +00:00
Compare commits
1 Commits
users/saks
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5fbbb485e2 |
34
package-lock.json
generated
34
package-lock.json
generated
@@ -15191,6 +15191,8 @@
|
||||
},
|
||||
"node_modules/buffer-equal-constant-time": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
|
||||
"integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==",
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"node_modules/buffer-from": {
|
||||
@@ -17899,6 +17901,8 @@
|
||||
},
|
||||
"node_modules/ecdsa-sig-formatter": {
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz",
|
||||
"integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"safe-buffer": "^5.0.1"
|
||||
@@ -27702,21 +27706,23 @@
|
||||
}
|
||||
},
|
||||
"node_modules/jsonwebtoken/node_modules/jwa": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz",
|
||||
"integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==",
|
||||
"version": "1.4.2",
|
||||
"resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.2.tgz",
|
||||
"integrity": "sha512-eeH5JO+21J78qMvTIDdBXidBd6nG2kZjg5Ohz/1fpa28Z4CcsWUzJ1ZZyFq/3z3N17aZy+ZuBoHljASbL1WfOw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"buffer-equal-constant-time": "1.0.1",
|
||||
"buffer-equal-constant-time": "^1.0.1",
|
||||
"ecdsa-sig-formatter": "1.0.11",
|
||||
"safe-buffer": "^5.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/jsonwebtoken/node_modules/jws": {
|
||||
"version": "3.2.2",
|
||||
"resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz",
|
||||
"integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==",
|
||||
"version": "3.2.3",
|
||||
"resolved": "https://registry.npmjs.org/jws/-/jws-3.2.3.tgz",
|
||||
"integrity": "sha512-byiJ0FLRdLdSVSReO/U4E7RoEyOCKnEnEPMjq3HxWtvzLsV08/i5RQKsFVNkCldrCaPr2vDNAOMsfs8T/Hze7g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"jwa": "^1.4.1",
|
||||
"jwa": "^1.4.2",
|
||||
"safe-buffer": "^5.0.1"
|
||||
}
|
||||
},
|
||||
@@ -27763,19 +27769,23 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/jwa": {
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.1.tgz",
|
||||
"integrity": "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"buffer-equal-constant-time": "1.0.1",
|
||||
"buffer-equal-constant-time": "^1.0.1",
|
||||
"ecdsa-sig-formatter": "1.0.11",
|
||||
"safe-buffer": "^5.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/jws": {
|
||||
"version": "4.0.0",
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/jws/-/jws-4.0.1.tgz",
|
||||
"integrity": "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"jwa": "^2.0.0",
|
||||
"jwa": "^2.0.1",
|
||||
"safe-buffer": "^5.0.1"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,157 +0,0 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
import { CommandBarButton, DataExplorer, Editor, ONE_MINUTE_MS, TestAccount } from "../../fx";
|
||||
import { createTestSQLContainer, TestContainerContext } from "../../testData";
|
||||
|
||||
test.describe("Indexing Policy under Scale & Settings", () => {
|
||||
let context: TestContainerContext = null!;
|
||||
let explorer: DataExplorer = null!;
|
||||
|
||||
// Helper function to get the indexing policy editor
|
||||
const getIndexingPolicyEditor = (): Editor => {
|
||||
const editorContainer = explorer.frame.locator(".settingsV2Editor");
|
||||
return new Editor(explorer.frame, editorContainer);
|
||||
};
|
||||
|
||||
test.beforeAll("Create Test Database & Open Indexing Policy tab", async ({ browser }) => {
|
||||
context = await createTestSQLContainer();
|
||||
const page = await browser.newPage();
|
||||
explorer = await DataExplorer.open(page, TestAccount.SQL);
|
||||
|
||||
// Click Scale & Settings and open Indexing Policy tab
|
||||
await explorer.openScaleAndSettings(context);
|
||||
const indexingPolicyTab = explorer.frame.getByTestId("settings-tab-header/IndexingPolicyTab");
|
||||
await indexingPolicyTab.click();
|
||||
});
|
||||
|
||||
test.afterAll("Delete Test Database", async () => {
|
||||
await context?.dispose();
|
||||
});
|
||||
|
||||
test("Verify Indexing Policy tab is visible", async () => {
|
||||
const indexingPolicyTab = explorer.frame.getByTestId("settings-tab-header/IndexingPolicyTab");
|
||||
await expect(indexingPolicyTab).toBeVisible();
|
||||
});
|
||||
|
||||
test("Verify Indexing Policy editor is present", async () => {
|
||||
// The Monaco editor is rendered in a div with class settingsV2Editor
|
||||
const editorContainer = explorer.frame.locator(".settingsV2Editor");
|
||||
await expect(editorContainer).toBeVisible();
|
||||
|
||||
// Verify the editor has content (default indexing policy) using Editor helper
|
||||
const editor = getIndexingPolicyEditor();
|
||||
const editorContent = await editor.text();
|
||||
expect(editorContent).toBeTruthy();
|
||||
});
|
||||
|
||||
test("Update Indexing Policy - Change automatic to false", async () => {
|
||||
// Use helper function to get editor instance
|
||||
const editor = getIndexingPolicyEditor();
|
||||
|
||||
// Verify the Monaco editor is visible
|
||||
const editorElement = explorer.frame.locator(".settingsV2Editor").locator(".monaco-editor");
|
||||
await expect(editorElement).toBeVisible();
|
||||
|
||||
// Get current indexing policy content
|
||||
const currentContent = await editor.text();
|
||||
expect(currentContent).toBeTruthy();
|
||||
const indexingPolicy = JSON.parse(currentContent as string);
|
||||
|
||||
// Verify default policy structure
|
||||
expect(indexingPolicy).toHaveProperty("automatic");
|
||||
expect(indexingPolicy).toHaveProperty("indexingMode");
|
||||
|
||||
// Modify the indexing policy - change automatic to false
|
||||
indexingPolicy.automatic = false;
|
||||
const updatedContent = JSON.stringify(indexingPolicy, null, 4);
|
||||
|
||||
// Set the new content in the editor
|
||||
await editor.setText(updatedContent);
|
||||
|
||||
// Verify the warning message appears for unsaved changes
|
||||
const warningMessage = explorer.frame.locator(".ms-MessageBar--warning");
|
||||
await expect(warningMessage).toBeVisible({ timeout: 5000 });
|
||||
|
||||
// Save the changes
|
||||
await explorer.commandBarButton(CommandBarButton.Save).click();
|
||||
|
||||
// Verify success message
|
||||
await expect(explorer.getConsoleHeaderStatus()).toContainText(
|
||||
`Successfully updated container ${context.container.id}`,
|
||||
{
|
||||
timeout: 2 * ONE_MINUTE_MS,
|
||||
},
|
||||
);
|
||||
|
||||
// Verify warning message is no longer visible after save
|
||||
await expect(warningMessage).not.toBeVisible({ timeout: 5000 });
|
||||
});
|
||||
|
||||
test("Update Indexing Policy - Change indexingMode to lazy", async () => {
|
||||
// Use helper function to get editor instance
|
||||
const editor = getIndexingPolicyEditor();
|
||||
|
||||
// Verify the Monaco editor is visible
|
||||
const editorElement = explorer.frame.locator(".settingsV2Editor").locator(".monaco-editor");
|
||||
await expect(editorElement).toBeVisible();
|
||||
|
||||
// Get current indexing policy content
|
||||
const currentContent = await editor.text();
|
||||
expect(currentContent).toBeTruthy();
|
||||
const indexingPolicy = JSON.parse(currentContent as string);
|
||||
|
||||
// Modify the indexing policy - change indexingMode to lazy
|
||||
indexingPolicy.indexingMode = "lazy";
|
||||
const updatedContent = JSON.stringify(indexingPolicy, null, 4);
|
||||
|
||||
// Set the new content in the editor
|
||||
await editor.setText(updatedContent);
|
||||
|
||||
// Verify the warning message appears
|
||||
const warningMessage = explorer.frame.locator(".ms-MessageBar--warning");
|
||||
await expect(warningMessage).toBeVisible({ timeout: 5000 });
|
||||
|
||||
// Save the changes
|
||||
await explorer.commandBarButton(CommandBarButton.Save).click();
|
||||
|
||||
// Verify success message
|
||||
await expect(explorer.getConsoleHeaderStatus()).toContainText(
|
||||
`Successfully updated container ${context.container.id}`,
|
||||
{
|
||||
timeout: 2 * ONE_MINUTE_MS,
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
test("Update Indexing Policy - Revert automatic to true", async () => {
|
||||
// Use helper function to get editor instance
|
||||
const editor = getIndexingPolicyEditor();
|
||||
|
||||
// Verify the Monaco editor is visible
|
||||
const editorElement = explorer.frame.locator(".settingsV2Editor").locator(".monaco-editor");
|
||||
await expect(editorElement).toBeVisible();
|
||||
|
||||
// Get current indexing policy content
|
||||
const currentContent = await editor.text();
|
||||
expect(currentContent).toBeTruthy();
|
||||
const indexingPolicy = JSON.parse(currentContent as string);
|
||||
|
||||
// Revert the changes - set automatic back to true and indexingMode to consistent
|
||||
indexingPolicy.automatic = true;
|
||||
indexingPolicy.indexingMode = "consistent";
|
||||
const updatedContent = JSON.stringify(indexingPolicy, null, 4);
|
||||
|
||||
// Set the new content in the editor
|
||||
await editor.setText(updatedContent);
|
||||
|
||||
// Save the changes
|
||||
await explorer.commandBarButton(CommandBarButton.Save).click();
|
||||
|
||||
// Verify success message
|
||||
await expect(explorer.getConsoleHeaderStatus()).toContainText(
|
||||
`Successfully updated container ${context.container.id}`,
|
||||
{
|
||||
timeout: 2 * ONE_MINUTE_MS,
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user