Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests to verify the presence and non-empty content of <pre> elements #1917

Merged
merged 3 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ fourfront
Change Log
----------

8.4.5
=====

`PR 1917: Add tests to verify the presence and non-empty content of <pre> elements <https://github.com/4dn-dcic/fourfront/pull/1917>`_

* Update: Added tests to verify the presence and non-empty content of `<pre>` elements inside static section


8.4.4
=====
Expand Down
13 changes: 13 additions & 0 deletions deploy/post_deploy_testing/cypress/e2e/01b_static_content.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,19 @@ describe('Static Page & Content Tests', function () {
cy.title().should('equal', titleText + ' – 4DN Data Portal').end(); // Ensure <head>...<title>TITLE</title>...</head> matches.
prevTitle = titleText;

// Verify the presence of <pre> elements and ensure each one is not empty.
cy.document().then((doc) => {
const elements = doc.querySelectorAll('.rst-container > div > pre, .html-container > div > pre, .markdown-container > div > pre');
if (elements.length > 0) {
cy.get('.rst-container > div > pre, .html-container > div > pre, .markdown-container > div > pre').each(($pre) => {
const textContent = $pre.text().trim();
expect(textContent).to.not.be.empty;
});
} else {
cy.log('No <pre> elements found under .rst-container > div or .html-container > div, .markdown-container > div > pre');
}
});

if (!haveWeSeenPageWithTableOfContents) {
cy.window().then((w)=>{
if (w.document.querySelectorAll('div.table-of-contents li.table-content-entry a').length > 0){
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]
# Note: Various modules refer to this system as "encoded", not "fourfront".
name = "encoded"
version = "8.4.4"
version = "8.4.5"
description = "4DN-DCIC Fourfront"
authors = ["4DN-DCIC Team <[email protected]>"]
license = "MIT"
Expand Down
Loading