Skip to content

Test PR to show CI running#1168

Open
ryanfkeller wants to merge 68 commits intogh-pagesfrom
frontend-unit-tests
Open

Test PR to show CI running#1168
ryanfkeller wants to merge 68 commits intogh-pagesfrom
frontend-unit-tests

Conversation

@ryanfkeller
Copy link
Owner

@ryanfkeller ryanfkeller commented Nov 6, 2025

Test edit 2. Please note: You must be a member of the HFLA website team in order to create pull requests. Please see our page on how to join us as a member at HFLA: https://www.hackforla.org/getting-started. Delete this message if you joined this team via onboarding.

Fixes #replace_this_text_with_the_issue_number

What changes did you make?

Why did you make the changes (we will use this info to test)?

CodeQL Alerts

After the PR has been submitted and the resulting GitHub actions/checks have been completed, developers should check the PR for CodeQL alert annotations.

Check the PR's comments. If present on your PR, the CodeQL alert looks similar as shown

Screenshot 2024-10-28 154514

Please let us know that you have checked for CodeQL alerts. Please do not dismiss alerts.

  • I have checked this PR for CodeQL alerts and none were found.
  • I found CodeQL alert(s), and (select one):
    • I have resolved the CodeQL alert(s) as noted
    • I believe the CodeQL alert(s) is a false positive (Merge Team will evaluate)
    • I have followed the Instructions below, but I am still stuck (Merge Team will evaluate)
Instructions for resolving CodeQL alerts

If CodeQL alert/annotations appear, refer to How to Resolve CodeQL alerts.

In general, CodeQL alerts should be resolved prior to PR reviews and merging

Screenshots of Proposed Changes To The Website (if any, please do not include screenshots of code changes)

Visuals before changes are applied

image

Visuals after changes are applied

image

@github-actions
Copy link

github-actions bot commented Nov 6, 2025

@ryanfkeller, this Pull Request is not linked to a valid issue. Above, on the first line of your PR, please link the number of the issue that you worked on using the format of 'Fixes #' + issue number, for example: Fixes #9876

Note: Do not use the number of this PR.

@github-actions
Copy link

github-actions bot commented Nov 6, 2025

Want to review this pull request? Take a look at this documentation for a step by step guide!


From your project repository, check out a new branch and test the changes.

git checkout -b ryanfkeller-frontend-unit-tests gh-pages
git pull https://github.com/ryanfkeller/website.git frontend-unit-tests


try {
if (ext === ".json") {
dirData[name] = JSON.parse(fs.readFileSync(fullPath, 'utf-8'));

Check failure

Code scanning / CodeQL

Potential file system race condition High test

The file may have changed since it was checked.
dirData[name] = JSON.parse(fs.readFileSync(fullPath, 'utf-8'));
} else if (ext === '.yml' || ext === '.yaml') {
// Target YMLs might use multi-doc syntax, so we need to use loadAll
const ymlDocs = yaml.loadAll(fs.readFileSync(fullPath, 'utf-8'));

Check failure

Code scanning / CodeQL

Potential file system race condition High test

The file may have changed since it was checked.
---
---

import { filterTestEvents, sortEventsByDate } from "./vrms-events-utils.mjs";

Check notice

Code scanning / CodeQL

Syntax error Note

Error: Unexpected token

Copilot Autofix

AI 4 months ago

To fix the syntax error, all non-JavaScript code (i.e., the lines containing Liquid {% ... %} or {{ ... }} and the header --- lines) should be removed from assets/js/utility/vrms-events.mjs.

  • Delete lines 1 and 2 containing just ---.
  • Remove line 6, the {% assign vrmsData = site.data.external.vrms_data %} template code.
  • Replace line 7, which uses Liquid to attempt in-place assignment for vrmsData, with a regular JavaScript assignment or, if the file receives vrmsData via import or an environment variable, adjust accordingly. If template-time data injection is required, it should be done elsewhere, not inside a .mjs file. Since we do not know how vrmsData should be supplied at runtime, we can assign it to an empty array or provide a placeholder with a comment to indicate where data should be provided.
  • The rest of the code is valid ES module JavaScript and does not require changes.
Suggested changeset 1
assets/js/utility/vrms-events.mjs

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/assets/js/utility/vrms-events.mjs b/assets/js/utility/vrms-events.mjs
--- a/assets/js/utility/vrms-events.mjs
+++ b/assets/js/utility/vrms-events.mjs
@@ -1,11 +1,8 @@
----
----
-
 import { filterTestEvents, sortEventsByDate } from "./vrms-events-utils.mjs";
 
-{% assign vrmsData = site.data.external.vrms_data %}
-const vrmsData = JSON.parse(decodeURIComponent("{{ vrmsData | jsonify | uri_escape }}"));
-
+// TODO: Assign vrmsData to the appropriate value at runtime
+// Example: const vrmsData = []; // or import from an external source at runtime
+const vrmsData = []; // Placeholder assignment. Replace with actual data as needed.
 /* vrmsDataFetch calls sortByDate function and passes filteredVrmsData variable, current page which can either be "events" for the right-col-content.html page or 
 "project" from the project.html page, and passes the appendMeetingTimes function from projects.js that appends the sorted vrmsData 
 returned by sortByDate to project.html. AppendMeetingTimes is only called if vrmsDataFetch is being called from project.js for the project.html page 
EOF
@@ -1,11 +1,8 @@
---
---

import { filterTestEvents, sortEventsByDate } from "./vrms-events-utils.mjs";

{% assign vrmsData = site.data.external.vrms_data %}
const vrmsData = JSON.parse(decodeURIComponent("{{ vrmsData | jsonify | uri_escape }}"));

// TODO: Assign vrmsData to the appropriate value at runtime
// Example: const vrmsData = []; // or import from an external source at runtime
const vrmsData = []; // Placeholder assignment. Replace with actual data as needed.
/* vrmsDataFetch calls sortByDate function and passes filteredVrmsData variable, current page which can either be "events" for the right-col-content.html page or
"project" from the project.html page, and passes the appendMeetingTimes function from projects.js that appends the sorted vrmsData
returned by sortByDate to project.html. AppendMeetingTimes is only called if vrmsDataFetch is being called from project.js for the project.html page
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
</ul>
</div>
</nav>
`

Check notice

Code scanning / CodeQL

Semicolon insertion Note test

Avoid automated semicolon insertion (90% of all statements in the enclosing script have an explicit semicolon).

Copilot Autofix

AI 4 months ago

To fix this problem, we should ensure the assignment to defaultTestDom is followed by an explicit semicolon, as it is for other variable declarations and assignments in the file. This simply involves adding a semicolon immediately after the closing backtick at the end of line 20. This change maintains code style consistency and removes ambiguity regarding statement termination, without altering any program functionality.


Suggested changeset 1
tests/frontend/integration/hamburger-nav.intg.test.js

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/tests/frontend/integration/hamburger-nav.intg.test.js b/tests/frontend/integration/hamburger-nav.intg.test.js
--- a/tests/frontend/integration/hamburger-nav.intg.test.js
+++ b/tests/frontend/integration/hamburger-nav.intg.test.js
@@ -17,7 +17,7 @@
             </ul>
         </div>
     </nav>
-`
+`;
 
 let headerNav;
 let burgerImage;
EOF
@@ -17,7 +17,7 @@
</ul>
</div>
</nav>
`
`;

let headerNav;
let burgerImage;
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated

let headerNav;
let burgerImage;
let burgerIcon;

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note test

Unused variable burgerIcon.

Copilot Autofix

AI 4 months ago

To fix the problem, we should remove the declaration of the unused variable burgerIcon from the file tests/frontend/integration/hamburger-nav.intg.test.js. Specifically, line 24 (let burgerIcon;) can simply be deleted. This will improve code readability, reduce confusion, and eliminate pointless code.

Suggested changeset 1
tests/frontend/integration/hamburger-nav.intg.test.js

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/tests/frontend/integration/hamburger-nav.intg.test.js b/tests/frontend/integration/hamburger-nav.intg.test.js
--- a/tests/frontend/integration/hamburger-nav.intg.test.js
+++ b/tests/frontend/integration/hamburger-nav.intg.test.js
@@ -21,7 +21,6 @@
 
 let headerNav;
 let burgerImage;
-let burgerIcon;
 let burgerXIcon;
 
 /**********************
EOF
@@ -21,7 +21,6 @@

let headerNav;
let burgerImage;
let burgerIcon;
let burgerXIcon;

/**********************
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
let headerNav;
let burgerImage;
let burgerIcon;
let burgerXIcon;

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note test

Unused variable burgerXIcon.

Copilot Autofix

AI 4 months ago

The best way to fix this problem is to remove the unused variable declaration for burgerXIcon at line 25 in tests/frontend/integration/hamburger-nav.intg.test.js. This does not change any existing functionality, as the variable was never assigned or read, and also makes the code cleaner and easier to maintain.

Suggested changeset 1
tests/frontend/integration/hamburger-nav.intg.test.js

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/tests/frontend/integration/hamburger-nav.intg.test.js b/tests/frontend/integration/hamburger-nav.intg.test.js
--- a/tests/frontend/integration/hamburger-nav.intg.test.js
+++ b/tests/frontend/integration/hamburger-nav.intg.test.js
@@ -22,7 +22,6 @@
 let headerNav;
 let burgerImage;
 let burgerIcon;
-let burgerXIcon;
 
 /**********************
  * Test Helpers
EOF
@@ -22,7 +22,6 @@
let headerNav;
let burgerImage;
let burgerIcon;
let burgerXIcon;

/**********************
* Test Helpers
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
@github-actions
Copy link

github-actions bot commented Nov 6, 2025

@ryanfkeller, this Pull Request is not linked to a valid issue. Above, on the first line of your PR, please link the number of the issue that you worked on using the format of 'Fixes #' + issue number, for example: Fixes #9876

Note: Do not use the number of this PR.

@github-actions
Copy link

github-actions bot commented Nov 6, 2025

@ryanfkeller, this Pull Request is not linked to a valid issue. Above, on the first line of your PR, please link the number of the issue that you worked on using the format of 'Fixes #' + issue number, for example: Fixes #9876

Note: Do not use the number of this PR.

1 similar comment
@github-actions
Copy link

github-actions bot commented Nov 6, 2025

@ryanfkeller, this Pull Request is not linked to a valid issue. Above, on the first line of your PR, please link the number of the issue that you worked on using the format of 'Fixes #' + issue number, for example: Fixes #9876

Note: Do not use the number of this PR.

HackforLABot and others added 29 commits December 30, 2025 11:07
…rla#8449)

Bumps [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) from 7.0.0 to 7.1.0.
- [Release notes](https://github.com/stefanzweifel/git-auto-commit-action/releases)
- [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md)
- [Commits](stefanzweifel/git-auto-commit-action@v7.0.0...v7.1.0)

---
updated-dependencies:
- dependency-name: stefanzweifel/git-auto-commit-action
  dependency-version: 7.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
The devops repo is being renamed from
https://github.com/hackforla/ops
to
https://github.com/hackforla/devops

with this change users will be able to navigate
to the renamed repo from the hfla website's
communities of practice page:

https://www.hackforla.org/communities-of-practice
…orla#8437)

* changed program-areas to true

* added program-areas to default

* renamed citizen-engagement.html and moved to _layouts

* made card appear based on page program area

* made title reflect the page

* renamed _citizen_engagement.scss file and updated import in main.scss
* update devops name 8388

* reverting to normal

* redid changes for issue
Broke testable functions out from vrms-events and current-projects into their associated -utils files.
Added includeing the current-projects-utils.js script in current-projects
Updated ESM-syntax vrms-events to use the extension .mjs, so it will be interpreted correctly by the test runner.
Updated files that call vrms events to use the new extension.
Created hfla_test docker container that loads node:alpine for node environment testing
Adds startup container commands to install dependencies required for testing, AND to launch Jest -- depending on how we want to use this, we may want to roll that back
Adds a jest config that specifies where the source and test files are located, and how to map to our Jekyll transformer
Adds a Jekyll transformer that processes JS files when "require" or "import" is called on them to populate both the frontmatter and inline LiquidJS statements with the real site data -- mostly useful for integration testing
Two basic unit tests with the extracted pure-logic functions
Two "integration" tests, one demoing using a simulated DOMs, the other demoing testing against real Jekyll data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants