Skip to content

[Testing:InstructorUI] Legal name privacy#12562

Merged
bmcutler merged 30 commits into
Submitty:mainfrom
Khine12:legal-name-privacy-tests
Apr 30, 2026
Merged

[Testing:InstructorUI] Legal name privacy#12562
bmcutler merged 30 commits into
Submitty:mainfrom
Khine12:legal-name-privacy-tests

Conversation

@Khine12

@Khine12 Khine12 commented Mar 10, 2026

Copy link
Copy Markdown
Contributor

Why is this Change Important & Necessary?

Closes #8435
Legal names should never be displayed when a preferred name exists.
This PR adds E2E tests to verify legal names never appear in the UI.

What is the New Behavior?

Added name_privacy.spec.js to cypress/e2e/Cypress-UI/ which:

Sets preferred names for student, instructor, and TA users via the profile page
Visits multiple pages and verifies that none of their legal names appear in the HTML

What steps should a reviewer take to reproduce or test the bug or new feature?

Run: npx cypress run --headless --browser electron --spec cypress/e2e/Cypress-UI/name_privacy.spec.js
All tests should pass.

Automated Testing & Documentation

1 test added covering: users page, graders page, student photos, forum, and navigation page.

Other information

No breaking changes. No migrations needed.

@codecov

codecov Bot commented Mar 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 21.64%. Comparing base (d7b82e3) to head (a98f4ac).
⚠️ Report is 27 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##               main   #12562   +/-   ##
=========================================
  Coverage     21.64%   21.64%           
  Complexity     9654     9654           
=========================================
  Files           268      268           
  Lines         36244    36244           
  Branches        487      487           
=========================================
  Hits           7845     7845           
  Misses        27916    27916           
  Partials        483      483           
Flag Coverage Δ
autograder 21.32% <ø> (ø)
js 2.04% <ø> (ø)
migrator 100.00% <ø> (ø)
php 20.66% <ø> (ø)
python_submitty_utils 80.08% <ø> (ø)
submitty_daemon_jobs 91.13% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread site/cypress/e2e/Cypress-UI/name_privacy.spec.js Outdated
Comment thread site/cypress/e2e/Cypress-UI/name_privacy.spec.js Outdated
@github-project-automation github-project-automation Bot moved this from Seeking Reviewer to Work in Progress in Submitty Development Mar 10, 2026
@Khine12 Khine12 changed the title [Testing:UI] Add E2E tests to verify legal names are never displayed [Testing:InstructorUI] Legal name privacy Mar 10, 2026
@Rkoester47 Rkoester47 self-assigned this Mar 10, 2026
@automateprojectmangement automateprojectmangement Bot moved this from Work in Progress to In Review in Submitty Development Mar 10, 2026
Comment thread site/cypress/e2e/Cypress-UI/name_privacy.spec.js Outdated
Comment thread site/cypress/e2e/Cypress-UI/name_privacy.spec.js
@github-project-automation github-project-automation Bot moved this from In Review to Work in Progress in Submitty Development Mar 11, 2026
@Khine12
Khine12 requested a review from IDzyre March 11, 2026 23:04
@automateprojectmangement automateprojectmangement Bot moved this from Work in Progress to In Review in Submitty Development Mar 11, 2026
Comment thread site/cypress/e2e/Cypress-UI/name_privacy.spec.js Outdated
@Khine12
Khine12 requested a review from IDzyre March 12, 2026 21:33
@Khine12
Khine12 requested a review from IDzyre March 24, 2026 09:36
@automateprojectmangement automateprojectmangement Bot moved this from Work in Progress to In Review in Submitty Development Mar 24, 2026
@Khine12

Khine12 commented Mar 24, 2026

Copy link
Copy Markdown
Contributor Author

Hi @IDzyre, I've addressed all the requested changes. Could you take another look when you get a chance? All checks are passing. Thank you!

Sorry for the wait, I had finals this week and am currently on spring break. The test looks good currently, are there any other pages you can think of that shouldn't have the user's legal name attached? (Im not saying test every possible page on the site (yet) but the mainly used pages would be nice)

Thank you for your time in reviewing my PRs and for the feedback! For pages, the test currently checks: users, graders, student_photos, forum, and navigation. I think those cover the main instructor-facing pages. Happy to add more if you think of any!

@IDzyre

IDzyre commented Mar 26, 2026

Copy link
Copy Markdown
Member

Hi @IDzyre, I've addressed all the requested changes. Could you take another look when you get a chance? All checks are passing. Thank you!

Sorry for the wait, I had finals this week and am currently on spring break. The test looks good currently, are there any other pages you can think of that shouldn't have the user's legal name attached? (Im not saying test every possible page on the site (yet) but the mainly used pages would be nice)

Thank you for your time in reviewing my PRs and for the feedback! For pages, the test currently checks: users, graders, student_photos, forum, and navigation. I think those cover the main instructor-facing pages. Happy to add more if you think of any!

Is there a reason you're only doing instructor facing pages?

@Khine12

Khine12 commented Mar 26, 2026

Copy link
Copy Markdown
Contributor Author

Hi @IDzyre, I've addressed all the requested changes. Could you take another look when you get a chance? All checks are passing. Thank you!

Sorry for the wait, I had finals this week and am currently on spring break. The test looks good currently, are there any other pages you can think of that shouldn't have the user's legal name attached? (Im not saying test every possible page on the site (yet) but the mainly used pages would be nice)

Thank you for your time in reviewing my PRs and for the feedback! For pages, the test currently checks: users, graders, student_photos, forum, and navigation. I think those cover the main instructor-facing pages. Happy to add more if you think of any!

Is there a reason you're only doing instructor facing pages?

No particular reason — good catch! I've updated the test to also check pages as TA and student. The test now has separate checks for each role: instructor (users, graders, student_photos, forum, navigation), TA (graders, forum, navigation), and student (forum, navigation).

@Khine12

Khine12 commented Mar 27, 2026

Copy link
Copy Markdown
Contributor Author

Hi @IDzyre, I've addressed all the requested changes. Could you take another look when you get a chance? All checks are passing. Thank you!

Sorry for the wait, I had finals this week and am currently on spring break. The test looks good currently, are there any other pages you can think of that shouldn't have the user's legal name attached? (Im not saying test every possible page on the site (yet) but the mainly used pages would be nice)

Thank you for your time in reviewing my PRs and for the feedback! For pages, the test currently checks: users, graders, student_photos, forum, and navigation. I think those cover the main instructor-facing pages. Happy to add more if you think of any!

Is there a reason you're only doing instructor facing pages?

No particular reason — good catch! I've updated the test to also check pages as TA and student. The test now has separate checks for each role: instructor (users, graders, student_photos, forum, navigation), TA (graders, forum, navigation), and student (forum, navigation).

When you get a chance, could a maintainer approve the workflow so CI can run? No rush — just want to make sure the new tests pass.

Comment on lines +32 to +60
it('Legal names should not appear on instructor pages', () => {
cy.login('instructor');
const pages = ['users', 'graders', 'student_photos', 'forum', 'navigation'];
pages.forEach((page) => {
cy.visit(['sample', page]);
checkNoLegalNames();
});
cy.logout();
});

it('Legal names should not appear on TA pages', () => {
cy.login('ta');
const pages = ['graders', 'forum', 'navigation'];
pages.forEach((page) => {
cy.visit(['sample', page]);
checkNoLegalNames();
});
cy.logout();
});

it('Legal names should not appear on student pages', () => {
cy.login('student');
const pages = ['forum', 'navigation'];
pages.forEach((page) => {
cy.visit(['sample', page]);
checkNoLegalNames();
});
cy.logout();
});

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since these are such small tests, they can fall under the same umbrella it block, something like it('Should show preferred names not legal names')

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — combined the three it blocks into a single it('Should show preferred names not legal names') block as suggested.

@github-actions github-actions Bot added the Abandoned PR - Needs New Owner No activity on PR for more than 2 weeks -- seeking new owner to complete label Apr 17, 2026
@Khine12

Khine12 commented Apr 20, 2026

Copy link
Copy Markdown
Contributor Author

Hi, just checking in — I've addressed the review feedback, and this PR is still active on my end. Happy to make any additional changes if needed. Let me know!

@bmcutler
bmcutler merged commit 6ca5841 into Submitty:main Apr 30, 2026

@Rkoester47 Rkoester47 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests pass locally and you have implemented all suggested changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Abandoned PR - Needs New Owner No activity on PR for more than 2 weeks -- seeking new owner to complete

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Write tests to make sure legal first name & legal last name are never displayed

4 participants