fix: ui tests
This commit is contained in:
parent
fbf4e29e25
commit
c8f499ab2f
3 changed files with 18 additions and 10 deletions
|
|
@ -120,7 +120,7 @@ context("Control Link", () => {
|
|||
cy.get("@input").trigger("mouseover");
|
||||
cy.get(".frappe-control[data-fieldname=link] .btn-open")
|
||||
.should("be.visible")
|
||||
.should("have.attr", "href", `/app/todo/${todos[0]}`);
|
||||
.should("have.attr", "href", `/desk/todo/${todos[0]}`);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -176,7 +176,7 @@ context("Control Link", () => {
|
|||
|
||||
it("should update dependant fields (via fetch_from)", () => {
|
||||
cy.get("@todos").then((todos) => {
|
||||
cy.visit(`/app/todo/${todos[0]}`);
|
||||
cy.visit(`/desk/todo/${todos[0]}`);
|
||||
cy.intercept("POST", "/api/method/frappe.desk.search.search_link").as("search_link");
|
||||
cy.intercept("/api/method/frappe.client.validate_link*").as("validate_link");
|
||||
|
||||
|
|
|
|||
|
|
@ -27,13 +27,18 @@ frappe.ui.Sidebar = class Sidebar {
|
|||
}
|
||||
|
||||
prepare() {
|
||||
this.sidebar_data = frappe.boot.workspace_sidebar_item[this.workspace_title.toLowerCase()];
|
||||
this.workspace_sidebar_items = this.sidebar_data.items;
|
||||
if (this.edit_mode) {
|
||||
this.workspace_sidebar_items = this.new_sidebar_items;
|
||||
try {
|
||||
this.sidebar_data =
|
||||
frappe.boot.workspace_sidebar_item[this.workspace_title.toLowerCase()];
|
||||
this.workspace_sidebar_items = this.sidebar_data.items;
|
||||
if (this.edit_mode) {
|
||||
this.workspace_sidebar_items = this.new_sidebar_items;
|
||||
}
|
||||
this.choose_app_name();
|
||||
this.find_nested_items();
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
this.choose_app_name();
|
||||
this.find_nested_items();
|
||||
}
|
||||
|
||||
choose_app_name() {
|
||||
|
|
@ -350,7 +355,9 @@ frappe.ui.Sidebar = class Sidebar {
|
|||
workspace_title = this.get_correct_workspace_sidebars(route);
|
||||
}
|
||||
let module_name = workspace_title[0];
|
||||
frappe.app.sidebar.setup(module_name || this.workspace_title);
|
||||
if (module_name) {
|
||||
frappe.app.sidebar.setup(module_name || this.workspace_title);
|
||||
}
|
||||
}
|
||||
|
||||
get_correct_workspace_sidebars(link_to) {
|
||||
|
|
@ -718,6 +725,7 @@ frappe.ui.Sidebar = class Sidebar {
|
|||
message: __("Saving Sidebar"),
|
||||
indicator: "success",
|
||||
});
|
||||
|
||||
await frappe.call({
|
||||
type: "POST",
|
||||
method: "frappe.desk.doctype.workspace_sidebar.workspace_sidebar.add_sidebar_items",
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ frappe.ui.SidebarHeader = class SidebarHeader {
|
|||
this.$drop_icon = this.wrapper.find(".drop-icon");
|
||||
}
|
||||
set_header_icon() {
|
||||
this.header_icon = this.sidebar.sidebar_data.header_icon;
|
||||
if (this.sidebar.sidebar_data) this.header_icon = this.sidebar.sidebar_data.header_icon;
|
||||
}
|
||||
setup_app_switcher() {
|
||||
this.dropdown_menu = $(".sidebar-header-menu");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue