mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-04-22 22:42:06 +01:00
feat: add copyable ID to delete confirmation dialogs
When deleting databases or containers, the confirmation dialog now displays the resource ID in a read-only text field with a copy button, allowing users to copy-paste the ID into the confirmation input instead of typing it manually. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -62,13 +62,15 @@ describe("Delete Database Confirmation Pane", () => {
|
||||
const wrapper = mount(<DeleteDatabaseConfirmationPanel refreshDatabases={() => undefined} />);
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
expect(wrapper.exists("#confirmDatabaseId")).toBe(true);
|
||||
expect(wrapper.exists("#copyableDatabaseId")).toBe(true);
|
||||
expect(wrapper.find("#copyableDatabaseId").hostNodes().prop("value")).toBe(selectedDatabaseId);
|
||||
|
||||
wrapper
|
||||
.find("#confirmDatabaseId")
|
||||
.hostNodes()
|
||||
.simulate("change", { target: { value: selectedDatabaseId } });
|
||||
expect(wrapper.exists("button")).toBe(true);
|
||||
wrapper.find("button").hostNodes().simulate("submit");
|
||||
wrapper.find("#sidePanelOkButton").hostNodes().simulate("submit");
|
||||
expect(deleteDatabase).toHaveBeenCalledWith(selectedDatabaseId);
|
||||
wrapper.unmount();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user