test: apply doctype filter while seearching file

This commit is contained in:
Ejaaz Khan 2025-12-09 17:25:40 +05:30
parent 6a45fde134
commit f04cc04502
2 changed files with 17 additions and 3 deletions

View file

@ -224,7 +224,7 @@ context("Attach Control with Failed Document Save", () => {
.should("have.attr", "href")
.and("equal", "https://wallpaperplay.com/walls/full/8/2/b/72402.jpg");
cy.get(".title-text").then(($value) => {
cy.get(".title-text-form").then(($value) => {
docname = $value.text();
});
});
@ -238,6 +238,18 @@ context("Attach Control with Failed Document Save", () => {
.blur()
.wait(500);
cy.get('input[data-fieldname="attached_to_name"]').click().type(docname).blur();
cy.findByRole("button", { name: "+ Add a Filter" }).click();
cy.get(".fieldname-select-area .form-control")
.last()
.click()
.type("Attached To Doctype{enter}")
.blur()
.wait(500);
cy.get('input[data-fieldname="attached_to_doctype"]')
.last()
.click()
.type("Test Mandatory Attach Control")
.blur();
cy.get(".filter-popover .apply-filters").click({ force: true });
cy.get("header .level-right .list-count").should("contain.text", "1 of 1");
});

View file

@ -85,7 +85,9 @@ frappe.breadcrumbs = {
const el = document.createElement("li");
const a = document.createElement("a");
a.href = route;
a.classList.add(css_classes);
if (css_classes) {
a.classList.add(css_classes);
}
a.innerText = label;
el.appendChild(a);
this.$breadcrumbs.append(el);
@ -203,7 +205,7 @@ frappe.breadcrumbs = {
} else {
docname_title = doc.name;
}
this.append_breadcrumb_element(form_route, docname_title);
this.append_breadcrumb_element(form_route, docname_title, "title-text-form");
if (view === "form") {
let last_crumb = this.$breadcrumbs.find("li").last();