mirror of
https://github.com/hanzoai/id.git
synced 2026-10-16 18:38:15 +00:00
Sign in reads "No account? Create a new account"
The owner's wording for the line under the sign-in column. Same link, same gate on enableSignUp, same request carried to /signup. Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
@@ -83,7 +83,7 @@ const REQUEST = new URLSearchParams({
|
||||
})
|
||||
|
||||
for (const h of HOSTS) {
|
||||
test(`${h.host}: email first, then "or", then every other way in, then Create account`, async ({ context, page }, info) => {
|
||||
test(`${h.host}: email first, then "or", then every other way in, then Create a new account`, async ({ context, page }, info) => {
|
||||
await serve(context, h)
|
||||
await page.goto(`https://${h.host}/login`)
|
||||
await expect(page.locator('[data-provider="phone"]')).toBeVisible()
|
||||
@@ -105,10 +105,10 @@ for (const h of HOSTS) {
|
||||
'Continue with Wallet',
|
||||
'Continue with Phone',
|
||||
'Forgot password?',
|
||||
'Create account',
|
||||
'Create a new account',
|
||||
'footer',
|
||||
])
|
||||
await expect(page.getByText("Don't have an account?")).toBeVisible()
|
||||
await expect(page.getByText('No account?')).toBeVisible()
|
||||
await expect(page.locator('a[href^="/signup"]')).toHaveCount(1)
|
||||
|
||||
// Laid out in that order too, not just written in it.
|
||||
@@ -125,7 +125,7 @@ for (const h of HOSTS) {
|
||||
test(`${h.host}: Create account opens registration with the same request, and Sign in comes back`, async ({ context, page }) => {
|
||||
await serve(context, h)
|
||||
await page.goto(`https://${h.host}/login/oauth/authorize?${REQUEST}`)
|
||||
await page.getByRole('link', { name: 'Create account' }).click()
|
||||
await page.getByRole('link', { name: 'Create a new account' }).click()
|
||||
|
||||
await expect(page.getByRole('heading', { level: 1 })).toHaveText(/^Create your .+ account$/)
|
||||
let at = new URL(page.url())
|
||||
@@ -144,7 +144,7 @@ for (const h of HOSTS) {
|
||||
await page.goto(`https://${h.host}/login`, { waitUntil: 'networkidle' })
|
||||
await expect(page.locator('[data-provider="phone"]')).toBeVisible()
|
||||
await expect(page.getByText('Forgot password?')).toBeVisible()
|
||||
await expect(page.getByText("Don't have an account?")).toHaveCount(0)
|
||||
await expect(page.getByText('No account?')).toHaveCount(0)
|
||||
await expect(page.locator('a[href^="/signup"]')).toHaveCount(0)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ function column(): string[] {
|
||||
return [...nodes].map((n) => n.textContent?.trim() ?? '')
|
||||
}
|
||||
|
||||
test('the credential form leads, then "or", then the other ways in, then Create account', async () => {
|
||||
test('the credential form leads, then "or", then the other ways in, then Create a new account', async () => {
|
||||
land()
|
||||
render(<Login client={createAuthClient({ org: ORG, fetchImpl: offersAll() })} brand={BRAND} />)
|
||||
await waitFor(() => assert.ok(document.querySelector('[data-provider="phone"]')))
|
||||
@@ -184,9 +184,9 @@ test('the credential form leads, then "or", then the other ways in, then Create
|
||||
'Continue with Wallet',
|
||||
'Continue with Phone',
|
||||
'Forgot password?',
|
||||
'Create account',
|
||||
'Create a new account',
|
||||
])
|
||||
assert.ok(document.body.textContent?.includes("Don't have an account? Create account"))
|
||||
assert.ok(document.body.textContent?.includes('No account? Create a new account'))
|
||||
})
|
||||
|
||||
test('Create account opens registration for the same application, with the whole request', async () => {
|
||||
@@ -228,8 +228,8 @@ function remembering(read: typeof fetch, pending: Promise<unknown>[]): typeof fe
|
||||
|
||||
function noRegistration() {
|
||||
const text = document.body.textContent ?? ''
|
||||
assert.equal(text.includes('Create account'), false, 'no registration control')
|
||||
assert.equal(text.includes('have an account'), false, 'no registration prompt')
|
||||
assert.equal(text.includes('Create a new account'), false, 'no registration control')
|
||||
assert.equal(text.includes('No account?'), false, 'no registration prompt')
|
||||
assert.equal(document.querySelector('a[href^="/signup"]'), null, 'nothing links to /signup')
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ export function Login({ client, brand }: { client: AuthClient; brand: Brand }) {
|
||||
|
||||
const clientId = clientIdOverride ?? client.org.clientId
|
||||
|
||||
// Whether this application takes new accounts. "Create account" is drawn only
|
||||
// Whether this application takes new accounts. "Create a new account" is drawn only
|
||||
// when IAM says yes; an unreadable answer draws nothing. The server stays the
|
||||
// only gate.
|
||||
const [signupOpen, setSignupOpen] = useState(false)
|
||||
@@ -324,13 +324,13 @@ export function Login({ client, brand }: { client: AuthClient; brand: Brand }) {
|
||||
<a href={`/forget${window.location.search}`}>Forgot password?</a>
|
||||
</p>
|
||||
{/* The way in for somebody with no account, as the last line of the
|
||||
column: the mirror of the signup page's "Already have an account?".
|
||||
column, in the style of the signup page's "Already have an account?".
|
||||
It opens registration for the same application with the same
|
||||
request, so the new account returns to the app that sent it. */}
|
||||
{signupOpen ? (
|
||||
<p className="hanzo-id-footer-links">
|
||||
Don't have an account?{' '}
|
||||
<a href={signupHref(window.location.pathname, window.location.search)}>Create account</a>
|
||||
No account?{' '}
|
||||
<a href={signupHref(window.location.pathname, window.location.search)}>Create a new account</a>
|
||||
</p>
|
||||
) : null}
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user