diff --git a/cypress/integration/discussions.js b/cypress/integration/discussions.js index a6e0ff9b56..caf7d6c3f9 100644 --- a/cypress/integration/discussions.js +++ b/cypress/integration/discussions.js @@ -37,24 +37,24 @@ context('Discussions', () => { }; const reply_through_comment_box = () => { - cy.get('.discussion-on-page:visible .comment-field') + cy.get('.discussion-form:visible .comment-field') .type('This is a discussion from the cypress ui tests. \n\nThis comment was entered through the commentbox on the page.') .should('have.value', 'This is a discussion from the cypress ui tests. \n\nThis comment was entered through the commentbox on the page.'); - cy.get('.discussion-on-page:visible .submit-discussion').click(); + cy.get('.discussion-form:visible .submit-discussion').click(); cy.wait(3000); cy.get('.discussion-on-page:visible').should('have.class', 'show'); - cy.get('.discussion-on-page:visible').children(".reply-card").eq(1).children(".reply-text") + cy.get('.discussion-on-page:visible').children(".reply-card").eq(1).find(".reply-text") .should('have.text', 'This is a discussion from the cypress ui tests. \n\nThis comment was entered through the commentbox on the page.\n'); }; const cancel_and_clear_comment_box = () => { - cy.get('.discussion-on-page:visible .comment-field') + cy.get('.discussion-form:visible .comment-field') .type('This is a discussion from the cypress ui tests.') .should('have.value', 'This is a discussion from the cypress ui tests.'); - cy.get('.discussion-on-page:visible .cancel-comment').click(); - cy.get('.discussion-on-page:visible .comment-field').should('have.value', ''); + cy.get('.discussion-form:visible .cancel-comment').click(); + cy.get('.discussion-form:visible .comment-field').should('have.value', ''); }; const single_thread_discussion = () => { @@ -62,13 +62,13 @@ context('Discussions', () => { cy.get('.discussions-sidebar').should('have.length', 0); cy.get('.reply').should('have.length', 0); - cy.get('.discussion-on-page .comment-field') + cy.get('.discussion-form:visible .comment-field') .type('This comment is being made on a single thread discussion.') .should('have.value', 'This comment is being made on a single thread discussion.'); - cy.get('.discussion-on-page .submit-discussion').click(); + cy.get('.discussion-form:visible .submit-discussion').click(); cy.wait(3000); - cy.get('.discussion-on-page').children(".reply-card").eq(-1).children(".reply-text") + cy.get('.discussion-on-page').children(".reply-card").eq(-1).find(".reply-text") .should('have.text', 'This comment is being made on a single thread discussion.\n'); }; diff --git a/frappe/templates/discussions/discussions.js b/frappe/templates/discussions/discussions.js index 443216a309..dab6287a24 100644 --- a/frappe/templates/discussions/discussions.js +++ b/frappe/templates/discussions/discussions.js @@ -132,7 +132,7 @@ const update_message = (data) => { reply_card.find(".reply-edit-card").addClass("hide"); reply_card.find(".reply-text").html(data.reply); reply_card.find(".reply-actions").addClass("hide"); -} +}; const post_message_cleanup = () => { $(".topic-title").val(""); diff --git a/frappe/templates/discussions/reply_section.html b/frappe/templates/discussions/reply_section.html index 828f6dae31..da3c95737a 100644 --- a/frappe/templates/discussions/reply_section.html +++ b/frappe/templates/discussions/reply_section.html @@ -5,13 +5,13 @@ {% endif %} -
{% if not single_thread %}
- +
diff --git a/frappe/templates/styles/discussion_style.css b/frappe/templates/styles/discussion_style.css index 4d58ef7aa9..8bbab6c897 100644 --- a/frappe/templates/styles/discussion_style.css +++ b/frappe/templates/styles/discussion_style.css @@ -139,7 +139,7 @@ .discussion-heading { font-weight: 600; - font-size: 22px; + font-size: var(--text-3xl); line-height: 146%; letter-spacing: -0.0175em; color: var(--gray-900); @@ -187,8 +187,10 @@ } .reply-author { + display: flex; + align-items: center; margin: 0px 8px; - font-size: 12px; + font-size: var(--text-sm); line-height: 135%; color: var(--gray-900); } @@ -252,11 +254,6 @@ margin-bottom: 2.5rem; } -.reply-author { - display: flex; - align-items: center; -} - .reply-header { display: flex; align-items: center; diff --git a/frappe/tests/ui_test_helpers.py b/frappe/tests/ui_test_helpers.py index 26c20f3d18..263cc0e70c 100644 --- a/frappe/tests/ui_test_helpers.py +++ b/frappe/tests/ui_test_helpers.py @@ -199,39 +199,40 @@ def create_data_for_discussions(): def create_web_page(title, route, single_thread): web_page = frappe.db.exists("Web Page", {"route": route}) - if not web_page: - web_page = frappe.get_doc({ + if web_page: + return web_page + web_page = frappe.get_doc({ "doctype": "Web Page", "title": title, "route": route, "published": True }) - web_page.save() + web_page.save() - web_page.append("page_blocks", { - "web_template": "Discussions", - "web_template_values": frappe.as_json({ - "title": "Discussions", - "cta_title": "New Discussion", - "docname": web_page.name, - "single_thread": single_thread - }) + web_page.append("page_blocks", { + "web_template": "Discussions", + "web_template_values": frappe.as_json({ + "title": "Discussions", + "cta_title": "New Discussion", + "docname": web_page.name, + "single_thread": single_thread }) - web_page.save() + }) + web_page.save() - return web_page + return web_page.name def create_topic_and_reply(web_page): topic = frappe.db.exists("Discussion Topic",{ "reference_doctype": "Web Page", - "reference_docname": web_page.name + "reference_docname": web_page }) if not topic: topic = frappe.get_doc({ "doctype": "Discussion Topic", "reference_doctype": "Web Page", - "reference_docname": web_page.name, + "reference_docname": web_page, "title": "Test Topic" }) topic.save() @@ -268,4 +269,4 @@ def update_child_table(name): 'options': 'Doctype to Link' }) - doc.save() \ No newline at end of file + doc.save()