-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[v5] Upgrade/Rollback E2E Tests #8025
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces comprehensive enhancements to the ExpressSample in msal-browser-samples, focusing on MSAL version switching capabilities, end-to-end testing infrastructure, and improved authentication data display. The changes enable robust testing of upgrade/downgrade scenarios between different MSAL versions while providing better visibility into authentication flows.
Key changes include:
- Enhanced version switching logic with support for granular version selection (latest, latest-v4, latest-v3, custom versions)
- Complete E2E testing infrastructure with dedicated test files, configuration, and CI pipeline integration
- Improved authentication data display showing both profile information and raw MSAL authentication responses
Reviewed Changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
server.js |
Refactored version switching logic to support v3, v4, and latest versions with improved NPM version fetching |
test/upgrade-downgrade.spec.ts |
New comprehensive E2E test suite for version upgrade/downgrade scenarios |
test/test-helpers.ts |
Helper functions for E2E tests including sign-in, version switching, and cache verification |
public/js/graph.js |
Updated to return and display both profile data and authentication response data |
public/js/auth.js |
Modified to return full authentication response instead of just access token |
views/partials/profile-content.hbs |
Added new section to display raw authentication data alongside profile information |
public/js/versionSwitcher.js |
Added unique IDs to version dropdown items and improved UI state management |
public/js/app.js |
Enhanced UI initialization to show buttons only after event handlers are registered |
Configuration files | Added Jest config, TypeScript config, environment file, and updated package.json for E2E testing |
samples/msal-browser-samples/ExpressSample/test/upgrade-downgrade.spec.ts
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This pull request introduces several improvements and new features to the
ExpressSample
in themsal-browser-samples
, focusing on enhanced version switching, improved authentication and profile data display, and better testability. The most significant changes include a refactor of the MSAL version switching logic to support more granular version selection, expanded end-to-end (E2E) testing support, and UI/UX improvements for displaying authentication data.Key changes:
Version switching and server logic improvements
server.js
to support explicit selection of the latest v4.x and v3.x versions, in addition to the general "latest" version. This includes improved caching and dynamic fetching of version numbers from NPM, and clearer naming/descriptions for each version option. [1] [2] [3]E2E testing and configuration enhancements
ExpressSample
, including a dedicated.env.e2e
file, ajest.config.cjs
configuration, and new test dependencies/scripts inpackage.json
. This enables automated, environment-specific testing for the sample app. [1] [2] [3] [4]Authentication and profile data display improvements
auth.js
andgraph.js
to return and display both the authentication response and profile data. A newdisplayAuthData
function sanitizes and shows authentication details in the UI, with sensitive fields redacted. [1] [2] [3] [4] [5]UI and styling refinements
.profile-json
CSS class to.json-content
and updated associated selectors for clarity and consistency. [1] [2]These changes collectively make the
ExpressSample
more robust, testable, and user-friendly, especially for scenarios involving MSAL version switching and debugging authentication flows.