Removed all govuk css (#2814)

* Removed all govuk css

* Updated reference files

* Removing govuk js

* Fixed casing for modules, removed unused page

* Got more reference images

* Updated template page

* Removed govuk padding util

* Updated hint to uswds hint

* More govuk cleanup

* Commiting backstopjs ref files

* Fixed all unit tests that broke due to brittleness around govuk styling

* Added new ref images

* Final removal of govuk

* Officially removed all govuk references

* Updated reference file

* Updated link to button

* UI modernization

* Cleanup

* removed govuk escaping tests since they are no longer needed

* Fix CodeQL security issue in escapeElementName function

- Escape backslashes first before other special characters
- Prevents potential double-escaping vulnerability
- Addresses CodeQL alert about improper string escaping

* Found more govuk removal. Fixed unit tests

* Add missing pipeline check to pre-commit

* updated test

* Updated e2e test

* More update to e2e test

* Fixed another e2e test

* Simple PR comments addressed

* More updates

* Updated backstop ref files

* Refactored folder selection for non-admins

* Updated redundant line

* Updated tests to include correct mocks

* Added more ref files

* Addressing carlos comments

* Addressing Carlo comments, cleanup of window initing

* More cleanup and addressing carlo comments

* Fixing a11 scan

* Fixed a few issues with javascript

* Fixed for pr

* Fixing e2e tests

* Tweaking e2e test

* Added more ref files and cleaned up urls.js

* Fixed bug with creating new template

* Removed brittle test - addressed code ql comment

* e2e race condition fix

* More e2e test fixes

* Updated e2e tests to not wait for text sent

* Updated test to not wait for button click response

* Made tear down more resilent if staging is down

* reverted e2e test to what was working before main merge

* Updated backstopRef images

* Updated gulp to include job-polling differently
This commit is contained in:
Alex Janousek
2025-10-06 09:38:54 -04:00
committed by GitHub
parent a366a10865
commit 6f5750f095
323 changed files with 2731 additions and 2796 deletions

283
urls.js
View File

@@ -1,163 +1,147 @@
const baseUrl = process.env.BACKSTOP_BASE_URL || 'http://localhost:6012';
// List of routes organized by section
const TEST_SERVICE_ID = 'da14b8fa-6a9e-4320-8484-9cd6e900c333';
const TEST_TEMPLATE_ID = '31588995-646b-40ae-bed1-617612d9245e';
const TEST_USER_ID = '6af522d0-2915-4e52-83a3-3690455a5fe6';
const servicePath = (path = '') => `/services/${TEST_SERVICE_ID}${path}`;
const userPath = (path = '') => `/user-profile${path}`;
const platformAdminPath = (path = '') => `/platform-admin${path}`;
const routes = {
// Main pages
main: [
public: [
{ label: 'Homepage', path: '/' },
{ label: 'Add Service', path: '/add-service' },
{ label: 'Support', path: '/support' },
{ label: 'Notify.gov Service Ending', path: '/notify-service-ending' },
{ label: 'Notify.gov Sign In', path: '/sign-in' },
{ label: 'Accessibility Statement', path: '/accessibility-statement' },
{ label: 'Sign In', path: '/sign-in' },
{ label: 'Sign Out', path: '/sign-out' },
{ label: 'Forgot Password', path: '/forgot-password' },
{ label: 'Add Service', path: '/add-service' },
{ label: 'Contact', path: '/contact' },
{ label: 'Studio', path: '/studio' },
{ label: 'Privacy', path: '/privacy' },
{ label: 'Accessibility Statement', path: '/accessibility-statement' },
{ label: 'Performance', path: '/performance' },
{ label: 'Service Ending', path: '/notify-service-ending' },
{ label: 'Email Not Received', path: '/email-not-received' },
{ label: 'Text Not Received', path: '/text-not-received' },
{ label: 'Performance', path: '/performance' },
// Registration pages with radio buttons
// Note: /register returns 404, registration is handled through login.gov
// { label: 'Register', path: '/register' },
// { label: 'Register From Invite', path: '/register/from-invite/example-token' },
{ label: 'Find Users', path: '/find-users-by-email' },
{ label: 'Find Services', path: '/find-services-by-name' },
],
authenticated: [
{
label: 'SMS Template Preview',
path: '/services/da14b8fa-6a9e-4320-8484-9cd6e900c333/send/31588995-646b-40ae-bed1-617612d9245e/one-off/step-0',
},
// Pages with govuk buttons that need testing
{
label: 'API Keys',
path: '/services/da14b8fa-6a9e-4320-8484-9cd6e900c333/api/keys',
},
// Pages to test radio buttons before converting govukRadios to USWDS
{
label: 'API Keys Create',
path: '/services/da14b8fa-6a9e-4320-8484-9cd6e900c333/api/keys/create',
},
{
label: 'Change User Auth',
path: '/users/6af522d0-2915-4e52-83a3-3690455a5fe6/change_auth',
},
{
label: 'User Profile Timezone',
path: '/user-profile/preferred_timezone',
},
{
label: 'Service Settings',
path: '/services/da14b8fa-6a9e-4320-8484-9cd6e900c333/service-settings',
},
{
label: 'Service Send Files By Email',
path: '/services/da14b8fa-6a9e-4320-8484-9cd6e900c333/service-settings/send-files-by-email',
},
{
label: 'Service SMS Prefix',
path: '/services/da14b8fa-6a9e-4320-8484-9cd6e900c333/service-settings/sms-prefix',
},
{
label: 'Send One Off Step 2',
path: '/services/da14b8fa-6a9e-4320-8484-9cd6e900c333/send/31588995-646b-40ae-bed1-617612d9245e/one-off/step-2',
},
{
label: 'Choose Template',
path: '/services/da14b8fa-6a9e-4320-8484-9cd6e900c333/templates',
},
{
label: 'Team Members',
path: '/services/da14b8fa-6a9e-4320-8484-9cd6e900c333/users',
},
{
label: 'All Activity',
path: '/activity/services/da14b8fa-6a9e-4320-8484-9cd6e900c333',
},
{
label: 'Invite User',
path: '/services/da14b8fa-6a9e-4320-8484-9cd6e900c333/users/invite',
},
{
label: 'Platform Admin Live Services',
path: '/platform-admin/live-services',
},
{
label: 'Add Organization',
path: '/organizations/add',
},
{
label: 'Uploads',
path: '/services/da14b8fa-6a9e-4320-8484-9cd6e900c333/uploads',
},
{
label: 'API Guest List',
path: '/services/da14b8fa-6a9e-4320-8484-9cd6e900c333/api/guest-list',
},
// User profile and auth pages with radio buttons
// Note: /set-up-your-profile requires special auth flow from login.gov
// {
// label: 'Set Up Your Profile',
// path: '/set-up-your-profile',
// },
{
label: 'Platform Admin User Auth Type',
path: '/users/6af522d0-2915-4e52-83a3-3690455a5fe6/change_auth',
},
// Service settings pages with radio buttons
{
label: 'Data Retention Add',
path: '/services/da14b8fa-6a9e-4320-8484-9cd6e900c333/data-retention/add',
},
{
label: 'Link Service to Organization',
path: '/services/da14b8fa-6a9e-4320-8484-9cd6e900c333/service-settings/link-service-to-organization',
},
// Template sender pages with radio buttons
{
label: 'Set Template Sender',
path: '/services/da14b8fa-6a9e-4320-8484-9cd6e900c333/send/31588995-646b-40ae-bed1-617612d9245e/set-sender',
},
{
label: 'Set Template Letter Sender',
path: '/services/da14b8fa-6a9e-4320-8484-9cd6e900c333/templates/31588995-646b-40ae-bed1-617612d9245e/set-template-sender',
},
errors: [
{ label: 'Error 403', path: '/error/403' },
{ label: 'Error 404', path: '/error/404' },
],
service: [
{ label: 'Service Dashboard', path: servicePath() },
{ label: 'Service Usage', path: servicePath('/usage') },
{ label: 'Service Template Usage', path: servicePath('/template-usage') },
{ label: 'Service Jobs', path: servicePath('/jobs') },
{ label: 'Service Notifications', path: servicePath('/notifications') },
{ label: 'Service History', path: servicePath('/history') },
{ label: 'Service Settings', path: servicePath('/service-settings') },
{ label: 'Service Settings Admin', path: servicePath('/service-settings?show_admin_view=true') },
{ label: 'Choose Template', path: servicePath('/templates') },
{ label: 'Team Members', path: servicePath('/users') },
{ label: 'Invite User', path: servicePath('/users/invite') },
{ label: 'All Activity', path: `/activity${servicePath()}` },
{ label: 'Uploads', path: servicePath('/uploads') },
],
serviceSettings: [
{ label: 'SMS Prefix', path: servicePath('/service-settings/sms-prefix') },
{ label: 'Send Files by Email', path: servicePath('/service-settings/send-files-by-email') },
{ label: 'Data Retention', path: servicePath('/data-retention') },
{ label: 'Data Retention Add', path: servicePath('/data-retention/add') },
{ label: 'Edit Billing Details', path: servicePath('/edit-billing-details') },
{ label: 'Edit Notes', path: servicePath('/notes') },
{ label: 'Link to Organization', path: servicePath('/service-settings/link-service-to-organization') },
],
templates: [
{ label: 'Template View', path: servicePath(`/templates/${TEST_TEMPLATE_ID}`) },
{ label: 'Template Versions', path: servicePath(`/templates/${TEST_TEMPLATE_ID}/versions`) },
{ label: 'Template Copy', path: servicePath('/templates/copy') },
{ label: 'Template Preview', path: servicePath(`/send/${TEST_TEMPLATE_ID}/one-off/step-0`) },
{ label: 'Template Send Step 2', path: servicePath(`/send/${TEST_TEMPLATE_ID}/one-off/step-2`) },
{ label: 'Set Template Sender', path: servicePath(`/send/${TEST_TEMPLATE_ID}/set-sender`) },
{ label: 'Set Template Letter Sender', path: servicePath(`/templates/${TEST_TEMPLATE_ID}/set-template-sender`) },
],
api: [
{ label: 'API Keys', path: servicePath('/api/keys') },
{ label: 'API Keys Create', path: servicePath('/api/keys/create') },
{ label: 'API Documentation', path: servicePath('/api/documentation') },
{ label: 'API Callbacks', path: servicePath('/api/callbacks') },
{ label: 'API Guest List', path: servicePath('/api/guest-list') },
],
userProfile: [
{ label: 'User Profile', path: userPath() },
{ label: 'User Profile Name', path: userPath('/name') },
{ label: 'User Profile Email', path: userPath('/email') },
{ label: 'User Profile Mobile', path: userPath('/mobile-number') },
{ label: 'User Profile Password', path: userPath('/password') },
{ label: 'User Profile Timezone', path: userPath('/preferred_timezone') },
{ label: 'Change User Auth', path: `/users/${TEST_USER_ID}/change_auth` },
],
organizations: [
{ label: 'Organizations List', path: '/organizations' },
{ label: 'Add Organization', path: '/organizations/add' },
],
platformAdmin: [
{ label: 'Platform Admin', path: platformAdminPath() },
{ label: 'Platform Admin Summary', path: platformAdminPath('/summary') },
{ label: 'Platform Admin Live Services', path: platformAdminPath('/live-services') },
{ label: 'Platform Admin Trial Services', path: platformAdminPath('/trial-services') },
{ label: 'Platform Admin Reports', path: platformAdminPath('/reports') },
{ label: 'Platform Admin Complaints', path: platformAdminPath('/complaints') },
{ label: 'Platform Admin Clear Cache', path: platformAdminPath('/clear-cache') },
],
platformAdminReports: [
{ label: 'Usage Report', path: platformAdminPath('/reports/usage-for-all-services') },
{ label: 'Volumes by Service', path: platformAdminPath('/reports/volumes-by-service') },
{ label: 'Daily Volumes', path: platformAdminPath('/reports/daily-volumes-report') },
],
platformAdminService: [
{ label: 'Switch Service Live', path: servicePath('/service-settings/switch-live') },
{ label: 'Switch Count as Live', path: servicePath('/service-settings/switch-count-as-live') },
{ label: 'Set Rate Limit', path: servicePath('/service-settings/set-rate-limit') },
{ label: 'Set Message Limit', path: servicePath('/service-settings/set-message-limit') },
{ label: 'Set SMS Allowance', path: servicePath('/service-settings/set-free-sms-allowance') },
],
documentation: [
{ label: 'Documentation', path: '/documentation' },
{ label: 'Pricing How to Pay', path: '/pricing/how-to-pay' },
{ label: 'Create Messages', path: '/using-notify/how-to/create-and-send-messages' },
{ label: 'Edit Messages', path: '/using-notify/how-to/edit-and-format-messages' },
{ label: 'Send Files by Email', path: '/using-notify/how-to/send-files-by-email' },
],
// Using Notify section
usingNotify: [
{ label: 'Get Started', path: '/using-notify/get-started' },
{ label: 'Trial Mode', path: '/using-notify/trial-mode' },
{ label: 'Pricing', path: '/using-notify/pricing' },
{ label: 'Pricing Billing Details', path: '/pricing/billing-details' },
{ label: 'Delivery Status', path: '/using-notify/delivery-status' },
{ label: 'How To', path: '/using-notify/how-to' },
{ label: 'Best Practices', path: '/using-notify/best-practices' },
],
// Best Practices subsection
bestPractices: [
{ label: 'Clear Goals', path: '/using-notify/best-practices/clear-goals' },
{
label: 'Rules And Regulations',
path: '/using-notify/best-practices/rules-and-regulations',
},
{
label: 'Establish Trust',
path: '/using-notify/best-practices/establish-trust',
},
{
label: 'Write For Action',
path: '/using-notify/best-practices/write-for-action',
},
{
label: 'Multiple Languages',
path: '/using-notify/best-practices/multiple-languages',
},
{
label: 'Benchmark Performance',
path: '/using-notify/best-practices/benchmark-performance',
},
{ label: 'Rules and Regulations', path: '/using-notify/best-practices/rules-and-regulations' },
{ label: 'Establish Trust', path: '/using-notify/best-practices/establish-trust' },
{ label: 'Write for Action', path: '/using-notify/best-practices/write-for-action' },
{ label: 'Multiple Languages', path: '/using-notify/best-practices/multiple-languages' },
{ label: 'Benchmark Performance', path: '/using-notify/best-practices/benchmark-performance' },
],
// About section
about: [
{ label: 'About', path: '/about' },
{ label: 'Why Text Messaging', path: '/about/why-text-messaging' },
@@ -165,25 +149,34 @@ const routes = {
],
};
// Flatten all routes into a single array
const sublinks = [
...routes.main,
const allRoutes = [
...routes.public,
...routes.errors,
...routes.service,
...routes.serviceSettings,
...routes.templates,
...routes.api,
...routes.userProfile,
...routes.organizations,
...routes.platformAdmin,
...routes.platformAdminReports,
...routes.platformAdminService,
...routes.documentation,
...routes.usingNotify,
...routes.bestPractices,
...routes.about,
...routes.authenticated,
// Add more sections here as needed
];
const createFullUrl = (base, path) => `${base}${path}`;
// Build url using base and path
const constructUrls = (base, sublinks) =>
sublinks.reduce((acc, { label, path }) => {
return { ...acc, [label]: createFullUrl(base, path) };
const constructUrls = (base, routes) =>
routes.reduce((acc, { label, path }) => {
acc[label] = createFullUrl(base, path);
return acc;
}, {});
module.exports = {
baseUrl,
urls: constructUrls(baseUrl, sublinks),
urls: constructUrls(baseUrl, allRoutes),
routes,
};