Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Draft because stacked on #12431 |
759d212 to
999c8da
Compare
There was a problem hiding this comment.
Pull request overview
This PR restores and rewrites legacy .old test coverage across the Portal Web/API domains after the IdP refactor, updating fixtures and flows to match the current authentication and domain model. It also includes a few targeted application-code adjustments to align behavior with the rewritten tests and fix surfaced issues.
Changes:
- Replaced many legacy
.oldtests with updated.exsequivalents using the new*Fixturesmodules and updated sign-in/provider flows. - Updated Portal Web LiveViews to handle internet resource/site absence safely and to compute gateway online counts without per-render presence lookups.
- Hardened keyset pagination by validating cursor values during paginator initialization.
Reviewed changes
Copilot reviewed 88 out of 88 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| elixir/test/portal_web/live/sites/new_token_test.old | Removed legacy .old test file. |
| elixir/test/portal_web/live/sites/new_token_test.exs | Added rewritten tests for new-token page rendering and connection status element. |
| elixir/test/portal_web/live/sites/new_test.exs | Updated site creation tests to new fixtures/actor auth and updated form selectors/fields. |
| elixir/test/portal_web/live/sites/index_test.exs | Updated fixtures and added setup requirements (internet resource) + presence-driven table update assertions. |
| elixir/test/portal_web/live/sites/gateways/index_test.old | Removed legacy .old test file. |
| elixir/test/portal_web/live/sites/edit_test.exs | Updated site edit tests to new fixtures/actor auth and form selectors. |
| elixir/test/portal_web/live/sign_in_test.old | Removed legacy .old test file. |
| elixir/test/portal_web/live/sign_in_test.exs | Added rewritten sign-in page tests using new auth provider fixtures. |
| elixir/test/portal_web/live/sign_in/email_test.old | Removed legacy .old test file. |
| elixir/test/portal_web/live/sign_in/email_test.exs | Added rewritten email OTP LiveView tests (cookie/OTP flow). |
| elixir/test/portal_web/live/sidebar_test.old | Removed legacy .old test file. |
| elixir/test/portal_web/live/sidebar_test.exs | Added rewritten sidebar active-state and dropdown visibility tests using actor auth. |
| elixir/test/portal_web/live/settings/billing_test.old | Removed legacy .old test file. |
| elixir/test/portal_web/live/settings/account_test.exs | Updated account settings LiveView tests to new fixtures/actor auth; removed some legacy scenarios. |
| elixir/test/portal_web/live/settings/account/notifications_edit_test.exs | Updated notifications edit tests to new fixtures/actor auth and form selector. |
| elixir/test/portal_web/live/resources/index_test.old | Removed legacy .old test file. |
| elixir/test/portal_web/live/resources/index_test.exs | Added rewritten resources index LiveView tests (policies count, internet section, WAL hook reload). |
| elixir/test/portal_web/live/groups/show_test.old | Removed legacy .old test file. |
| elixir/test/portal_web/live/groups/new_test.old | Removed legacy .old test file. |
| elixir/test/portal_web/live/groups/index_test.old | Removed legacy .old test file. |
| elixir/test/portal_web/live/groups/edit_test.old | Removed legacy .old test file. |
| elixir/test/portal_web/live/groups/edit_actors_test.old | Removed legacy .old test file. |
| elixir/test/portal_web/live/clients/index_test.old | Removed legacy .old test file. |
| elixir/test/portal_web/live/clients/edit_test.exs | Updated client edit tests to new fixtures/actor auth and form selector. |
| elixir/test/portal_web/live/actors/users/new_test.old | Removed legacy .old test file. |
| elixir/test/portal_web/live/actors/users/new_identity_test.old | Removed legacy .old test file. |
| elixir/test/portal_web/live/actors/service_accounts/new_test.old | Removed legacy .old test file. |
| elixir/test/portal_web/live/actors/service_accounts/new_identity_test.old | Removed legacy .old test file. |
| elixir/test/portal_web/live/actors/new_test.old | Removed legacy .old test file. |
| elixir/test/portal_web/live/actors/index_test.old | Removed legacy .old test file. |
| elixir/test/portal_web/live/actors/groups_test.old | Removed legacy .old test file. |
| elixir/test/portal_web/controllers/sign_in_controller_test.old | Removed legacy .old controller test file. |
| elixir/test/portal_web/controllers/sign_in_controller_test.exs | Added rewritten client redirect cookie tests using PortalWeb.Cookie.ClientAuth. |
| elixir/test/portal_web/controllers/home_controller_test.exs | Updated “recent accounts” cookie test to use PortalWeb.Cookie.RecentAccounts; updated error message assertion. |
| elixir/test/portal_web/banner_test.old | Removed legacy .old test file. |
| elixir/test/portal_web/banner_test.exs | Added rewritten banner rendering tests using new fixtures/actor auth. |
| elixir/test/portal_web/authentication_test.exs | Added tests for PortalWeb.Authentication.take_sign_in_params/1 behavior. |
| elixir/test/portal_web/acceptance/auth_test.old | Removed legacy .old acceptance test file. |
| elixir/test/portal_web/acceptance/auth_test.exs | Added rewritten acceptance auth tests for provider options and sign-out flows. |
| elixir/test/portal_web/acceptance/auth/userpass_test.old | Removed legacy .old acceptance test file. |
| elixir/test/portal_web/acceptance/auth/userpass_test.exs | Added rewritten userpass acceptance flows aligned with new auth model/fields. |
| elixir/test/portal_web/acceptance/auth/openid_connect_test.old | Removed legacy .old acceptance test file. |
| elixir/test/portal_web/acceptance/auth/openid_connect_test.exs | Added rewritten OIDC acceptance tests using new identity fixture fields. |
| elixir/test/portal_web/acceptance/auth/email_test.old | Removed legacy .old acceptance test file. |
| elixir/test/portal_web/acceptance/auth/email_test.exs | Added rewritten email sign-in acceptance test for enumeration-safe UX. |
| elixir/test/portal_api/rate_limit.old | Removed legacy .old API rate limit test file. |
| elixir/test/portal_api/client/views/interface_test.exs | Updated interface view test to new client IP address field structure and DataCase usage. |
| elixir/test/portal/workers/outdated_gateways_test.old | Removed legacy .old worker test file. |
| elixir/test/portal/workers/delete_expired_one_time_passcodes_test.exs | Updated to call Portal.Authentication.create_one_time_passcode/2 and renamed alias accordingly. |
| elixir/test/portal/repo/filter_test.exs | Refactored query setup helper and adjusted invalid-type test cases. |
| elixir/test/portal/notifications/jobs/outdated_gateways_test.old | Removed legacy .old notifications job test file. |
| elixir/test/portal/mailer/sync_error_email_test.old | Removed legacy .old mailer test file. |
| elixir/test/portal/mailer/sync_error_email_test.exs | Added rewritten directory sync error email tests using directory fixtures. |
| elixir/test/portal/mailer/notifications_test.exs | Updated fixtures and adjusted expected outdated-clients URL format. |
| elixir/test/portal/mailer/auth_email_test.old | Removed legacy .old mailer test file. |
| elixir/test/portal/mailer/account_delete_email_test.exs | Updated to use SubjectFixtures instead of identity-based subject construction. |
| elixir/test/portal/crypto_test.old | Removed legacy .old test file. |
| elixir/test/portal/config_test.exs | Updated to new account fixture and updated expected validator error message formatting. |
| elixir/test/portal/config/validator_test.exs | Updated expected error messages for IP/CIDR validation failures. |
| elixir/test/portal/changes/hooks/tokens_test.old | Removed legacy .old hooks test file. |
| elixir/test/portal/changes/hooks/tokens_test.exs | Added rewritten hook tests targeting Portal.Changes.Hooks.ClientTokens. |
| elixir/test/portal/changes/hooks/resources_test.exs | Updated to new fixtures and PubSub subscription namespace; adjusted assertions. |
| elixir/test/portal/changes/hooks/policies_test.exs | Updated to new fixtures and PubSub subscription namespace; clarified breaking-update test naming. |
| elixir/test/portal/changes/hooks/memberships_test.exs | Updated PubSub subscription namespace and fixture imports; removed unused setup block. |
| elixir/test/portal/changes/hooks/gateways_test.exs | Updated to new fixtures and PubSub subscription namespace. |
| elixir/test/portal/changes/hooks/clients_test.exs | Updated to new fixtures and PubSub subscription namespace; updated policy authorization fixture usage. |
| elixir/test/portal/billing/stripe/api_client_test.old | Removed legacy .old Stripe client test file. |
| elixir/test/portal/billing/stripe/api_client_test.exs | Added rewritten Stripe API client tests using Req.Test stubs and Stripe mocks. |
| elixir/test/portal/billing/jobs/check_account_limits_test.old | Removed legacy .old billing job test file. |
| elixir/lib/portal_web/live/sites/new.ex | Simplified new-site changeset building to use cast/3 + Portal.Site.changeset/1. |
| elixir/lib/portal_web/live/sites/index.ex | Avoided nil crash when no internet resource; precomputed per-site gateway online counts for rendering. |
| elixir/lib/portal_web/live/clients/edit.ex | Refactored client edit changeset flow (casts/required fields; applies Portal.Client.changeset/1 on change). |
| elixir/lib/portal_web/authentication.ex | Added nil-safe clause for take_sign_in_params/1. |
| elixir/lib/portal/repo/paginator.ex | Added cursor value validation during paginator init to reject invalid cursor values early. |
| elixir/lib/portal/presence.ex | Reordered gateway presence tracking (Site before Account) to align reload behavior with current subscribers. |
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
This is mostly a change to make the presence tests less flaky.
There was a problem hiding this comment.
Some minor refactoring in this module.
There was a problem hiding this comment.
Prevents an invalid cursor from raising ArgumentError
| socket | ||
| |> assign(internet_resource: internet_resource) | ||
| |> assign(internet_site: internet_resource.site) | ||
| |> assign(internet_site: internet_resource && internet_resource.site) |
There was a problem hiding this comment.
Prevents the user from seeing a 500 if for some reason there is no internet resource for this account.
Restores/rewrites all of the
.oldtests from before the major IdP refactor.Some application code was changed in order to fix failing assertions (read: bugs).
Fixes #11056