mirror of
https://github.com/twentyhq/twenty.git
synced 2026-09-16 16:06:17 -04:00
## Summary Follow-up to #19837, which normalized `AI` to `Ai`. This applies the same treatment to the remaining mixed-case acronyms listed in twentyhq/core-team-issues#2419: `SSO`, `SAML`, `OIDC`, `API` and `URL` become `Sso`, `Saml`, `Oidc`, `Api`, `Url` in TypeScript identifiers and file names. **This is a pure internal rename.** Nothing that reaches the wire or the database changes: - GraphQL schema is untouched: resolver method names (`getAuthTokensFromSSOExchangeToken`, `getSSOIdentityProviders`, `createOIDCIdentityProvider`, ...), `@ObjectType('...')` strings, `registerEnumType` names, gql document contents, and `generated-metadata/graphql.ts` are byte-identical to main. Response field accesses on the front (`data.getAuthTokensFromSSOExchangeToken`) keep the schema spelling. - Three `@InputType()` classes whose class name fed the schema (`GetAuthorizationUrlForSSOInput`, `SetupOIDCSsoInput`, `SetupSAMLSsoInput`) now carry their previous name as an explicit `@InputType('...')` argument, so the class can be renamed without changing the schema. Same pattern the codebase already uses for `@ObjectType('SSOConnection')`. - `@Entity({ name: 'workspaceSSOIdentityProvider' })`, the DB enum names, migrations, and upgrade commands are untouched. - `SSO_BYPASS`, `AuthenticatedMethod.SSO`, `IdentityProviderType.SAML/OIDC` and other SCREAMING_SNAKE values stay as they are. - Browser and library APIs are preserved: `URLSearchParams`, `fileURLToPath`, `URL.createObjectURL`, Playwright's `APIResponse`, react-doc-viewer's `retainURLParams`, three.js `setURLModifier`. ## Scope decisions The issue was written in April against an older tree, so a few things differ from its table: - `JSONStringified` and `openAPIReference` no longer exist on main. Nothing to do. - The `API` acronym in server integration test helpers (`makeGraphqlAPIRequest`, `makeMetadataAPIRequest`, `makeRestAPIRequest`, ...) is used from ~330 spec files. That is left out on purpose: it is a self-contained follow-up, and folding it in here would make this PR conflict with every open PR that touches an integration test. Everything else under `API` (view persistence hooks, Google/Microsoft API services, e2e page objects) is renamed. - Trailing `URL` (`buildWorkspaceURL`, `baseURL`, `sanitizeURL`, ...) is the dominant convention in the codebase and was not in the issue's anchored regex. Left alone. Trailing `SSO`/`OIDC` (`useSSO`, `SignInUpWithSSO`, `getIssuerForOIDC`) is renamed since those files are explicitly listed in the issue. - `parseSAMLMetadataFromXMLFile` becomes `parseSamlMetadataFromXmlFile` rather than the half-renamed `parseSamlMetadataFromXMLFile`. - Leading-acronym values that should be camelCase are lowercased rather than PascalCased: `ssoIdentitiesProvidersState`, `ssoIdentitiesProvidersParamsSchema`, the `ssoIdp` prop, and local variables. Types and classes keep `Sso...`. - `components/SSO/` becomes `components/sso/`, matching the sibling `approvedAccessDomains/` directory rather than the `Sso/` suggested in the issue. - The `sSOService` / `sSOIdentityProviderDefaultValues` typos from the issue are fixed along the way. Locale `.po` files are not touched; their source-path comments will refresh on the next i18n extract. ## Rename methodology Anchored perl regex `(?<['"])(?<[A-Z.])ACRONYM([A-Z])(?=[a-z])`, excluding generated files, locales, migrations, fonts and vendored code, followed by targeted reverts for the schema, DB and library names listed above. Member accesses through `.` are excluded by the regex, so the enum members it renamed at their declaration (`AppTokenType.SsoExchangeToken`, `SignInUpStep.SsoIdentityProviderSelection`) were fixed by typecheck. ## Test plan - [x] `npx nx typecheck twenty-server` passes - [x] `npx nx typecheck twenty-front` passes - [x] `npx nx typecheck twenty-shared` and `twenty-front-component-renderer` pass - [x] `oxlint --type-aware` and `oxfmt --check` on all changed files in twenty-server and twenty-front: 0 errors, format clean - [x] `prettier --check` on all 165 changed TS files: clean - [x] Changed unit specs pass: 5 server suites (33 tests), 7 front suites (22 tests), twenty-shared `getUrlSafely`, component-renderer blob URL test - [x] `generated-metadata/graphql.ts` and every gql document are byte-identical to main - [ ] CI --- _Generated by [Claude Code](https://claude.ai/code/session_01JVjfAJ3MSzTKdyDh6fBMsG)_ <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/twentyhq/twenty/pull/25281?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
Twenty end-to-end (E2E) Testing
Prerequisite
Installing the browsers:
npx nx setup twenty-e2e-testing
Run end-to-end tests
npx nx test twenty-e2e-testing
Start the interactive UI mode
npx nx test:ui twenty-e2e-testing
Run test in specific file
npx nx test twenty-e2e-testing <filename>
Example (location of the test must be specified from the root of twenty-e2e-testing package):
npx nx test twenty-e2e-testing tests/login.spec.ts
Runs the tests in debug mode.
npx nx test:debug twenty-e2e-testing
Show report after tests
npx nx test:report twenty-e2e-testing
Q&A
Why there's path.resolve() everywhere?
That's thanks to differences in root directory when running tests using commands and using IDE. When running tests with commands,
the root directory is twenty/packages/twenty-e2e-testing, for IDE it depends on how someone sets the configuration. This way, it
ensures that no matter which IDE or OS Shell is used, the result will be the same.