@jskit-ai/auth-web 0.2.15 → 0.2.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,79 +1,72 @@
1
1
  <template>
2
- <div class="reset-screen" :class="{ 'reset-screen--mobile': isMobileViewport }">
3
- <v-container
4
- fluid
5
- class="reset-shell fill-height d-flex"
6
- :class="[
7
- isMobileViewport
8
- ? 'reset-shell--mobile align-stretch justify-stretch pa-0'
9
- : 'align-center justify-center py-8'
10
- ]"
2
+ <AuthScreen class="reset-screen" :class="{ 'reset-screen--mobile': isMobileViewport }">
3
+ <template v-if="$slots.brand" #brand="brand">
4
+ <slot name="brand" v-bind="brand" />
5
+ </template>
6
+ <v-card
7
+ class="reset-card"
8
+ :class="{ 'reset-card--mobile': isMobileViewport }"
9
+ variant="flat"
10
+ :rounded="isMobileViewport ? false : undefined"
11
11
  >
12
- <v-card
13
- class="reset-card"
14
- :class="{ 'reset-card--mobile': isMobileViewport }"
15
- :rounded="isMobileViewport ? false : 'lg'"
16
- :elevation="isMobileViewport ? 0 : 1"
17
- :border="!isMobileViewport"
18
- >
19
- <v-card-text class="reset-content" :class="{ 'reset-content--mobile': isMobileViewport }">
20
- <div class="reset-header mb-5">
21
- <h1 class="reset-title">{{ t("jskit.auth.resetPassword.title") }}</h1>
22
- </div>
12
+ <v-card-text class="reset-content" :class="{ 'reset-content--mobile': isMobileViewport }">
13
+ <div class="reset-header mb-5">
14
+ <h1 class="reset-title text-headline-medium">{{ t("jskit.auth.resetPassword.title") }}</h1>
15
+ </div>
23
16
 
24
- <v-alert v-if="errorMessage" type="error" variant="tonal" class="mb-4">
25
- {{ errorMessage }}
26
- </v-alert>
17
+ <v-alert v-if="errorMessage" type="error" variant="tonal" class="mb-4">
18
+ {{ errorMessage }}
19
+ </v-alert>
27
20
 
28
- <v-alert v-if="status === 'done'" type="success" variant="tonal" class="mb-4">
29
- {{ t("jskit.auth.resetPassword.done") }}
30
- </v-alert>
21
+ <v-alert v-if="status === 'done'" type="success" variant="tonal" class="mb-4">
22
+ {{ t("jskit.auth.resetPassword.done") }}
23
+ </v-alert>
31
24
 
32
- <v-progress-linear v-if="status === 'checking'" indeterminate color="primary" class="mb-4" />
25
+ <v-progress-linear v-if="status === 'checking'" indeterminate color="primary" class="mb-4" />
33
26
 
34
- <v-form v-if="status === 'ready'" @submit.prevent="submitReset" novalidate>
35
- <v-text-field
36
- v-model="password"
37
- :label="t('jskit.auth.resetPassword.newPassword')"
38
- :type="showPassword ? 'text' : 'password'"
39
- variant="outlined"
40
- density="comfortable"
41
- autocomplete="new-password"
42
- :append-inner-icon="showPassword ? '$visibilityOff' : '$visibility'"
43
- :error-messages="passwordError"
44
- class="mb-3"
45
- @click:append-inner="showPassword = !showPassword"
46
- />
47
- <v-text-field
48
- v-model="confirmPassword"
49
- :label="t('jskit.auth.resetPassword.confirmPassword')"
50
- :type="showConfirmPassword ? 'text' : 'password'"
51
- variant="outlined"
52
- density="comfortable"
53
- autocomplete="new-password"
54
- :append-inner-icon="showConfirmPassword ? '$visibilityOff' : '$visibility'"
55
- :error-messages="confirmPasswordError"
56
- class="mb-4"
57
- @click:append-inner="showConfirmPassword = !showConfirmPassword"
58
- />
59
- <v-btn block color="primary" size="large" type="submit" :loading="loading" :disabled="!canSubmit">
60
- {{ t("jskit.auth.resetPassword.submit") }}
61
- </v-btn>
62
- </v-form>
27
+ <v-form v-if="status === 'ready'" @submit.prevent="submitReset" novalidate>
28
+ <v-text-field
29
+ v-model="password"
30
+ :label="t('jskit.auth.resetPassword.newPassword')"
31
+ :type="showPassword ? 'text' : 'password'"
32
+ variant="outlined"
33
+ density="comfortable"
34
+ autocomplete="new-password"
35
+ :append-inner-icon="showPassword ? '$visibilityOff' : '$visibility'"
36
+ :error-messages="passwordError"
37
+ class="mb-3"
38
+ @click:append-inner="showPassword = !showPassword"
39
+ />
40
+ <v-text-field
41
+ v-model="confirmPassword"
42
+ :label="t('jskit.auth.resetPassword.confirmPassword')"
43
+ :type="showConfirmPassword ? 'text' : 'password'"
44
+ variant="outlined"
45
+ density="comfortable"
46
+ autocomplete="new-password"
47
+ :append-inner-icon="showConfirmPassword ? '$visibilityOff' : '$visibility'"
48
+ :error-messages="confirmPasswordError"
49
+ class="mb-4"
50
+ @click:append-inner="showConfirmPassword = !showConfirmPassword"
51
+ />
52
+ <v-btn block color="primary" size="large" type="submit" :loading="loading" :disabled="!canSubmit">
53
+ {{ t("jskit.auth.resetPassword.submit") }}
54
+ </v-btn>
55
+ </v-form>
63
56
 
64
- <div v-if="status === 'done' || status === 'error'" class="mt-4 d-flex justify-end">
65
- <v-btn variant="text" color="secondary" href="/auth/login">
66
- {{ t("jskit.auth.resetPassword.backToSignIn") }}
67
- </v-btn>
68
- </div>
69
- </v-card-text>
70
- </v-card>
71
- </v-container>
72
- </div>
57
+ <div v-if="status === 'done' || status === 'error'" class="mt-4 d-flex justify-end">
58
+ <v-btn variant="text" color="secondary" href="/auth/login">
59
+ {{ t("jskit.auth.resetPassword.backToSignIn") }}
60
+ </v-btn>
61
+ </div>
62
+ </v-card-text>
63
+ </v-card>
64
+ </AuthScreen>
73
65
  </template>
74
66
 
75
67
  <script setup>
76
68
  import { useDisplay } from "vuetify";
69
+ import AuthScreen from "./AuthScreen.vue";
77
70
  import { useDefaultResetPasswordView } from "../composables/useDefaultResetPasswordView.js";
78
71
  import { useJskitText } from "../i18n.js";
79
72
 
@@ -95,28 +88,14 @@ const {
95
88
  </script>
96
89
 
97
90
  <style scoped>
98
- .reset-screen {
99
- /* Start below shell banners shown on a surface without an app bar. */
100
- --auth-screen-height: calc(100dvh - var(--shell-error-banners-inline-height, 0px));
101
- position: fixed;
102
- inset: var(--shell-error-banners-inline-height, 0px) 0 0;
103
- z-index: 1;
104
- overflow-y: auto;
105
- min-height: var(--auth-screen-height);
106
- background-color: rgb(var(--v-theme-background));
107
- }
108
-
109
- .reset-shell {
110
- min-height: var(--auth-screen-height);
111
- }
112
-
113
91
  .reset-card {
114
92
  width: min(480px, 100%);
115
93
  }
116
94
 
95
+ /* On a phone the card is the screen below the brand row, if any. */
117
96
  .reset-card--mobile {
97
+ flex: 1 0 auto;
118
98
  width: 100%;
119
- min-height: var(--auth-screen-height);
120
99
  }
121
100
 
122
101
  .reset-content {
@@ -124,14 +103,11 @@ const {
124
103
  }
125
104
 
126
105
  .reset-content--mobile {
127
- min-height: var(--auth-screen-height);
128
- padding: calc(24px + env(safe-area-inset-top, 0px)) 20px calc(32px + env(safe-area-inset-bottom, 0px));
106
+ padding: calc(24px + var(--auth-screen-top-inset, 0px)) 20px calc(32px + env(safe-area-inset-bottom, 0px));
129
107
  }
130
108
 
131
109
  .reset-title {
132
110
  margin: 0;
133
- font-size: 28px;
134
- line-height: 1.2;
135
111
  color: rgb(var(--v-theme-on-surface));
136
112
  }
137
113
  </style>
@@ -1,59 +1,78 @@
1
1
  <template>
2
- <v-main class="signout-main">
3
- <v-container class="fill-height d-flex align-center justify-center py-8">
4
- <v-card class="signout-card">
5
- <v-card-text class="pa-7">
6
- <h1 class="text-headline-small mb-3">{{ t("jskit.auth.signOut.title") }}</h1>
7
-
8
- <p v-if="status === 'pending'" class="on-surface-variant mb-4">
9
- {{ t("jskit.auth.signOut.pending") }}
10
- </p>
11
-
12
- <p v-if="status === 'error'" class="text-body-large on-surface-variant mb-4">
13
- {{ errorMessage || t("jskit.auth.signOut.failedTryAgain") }}
14
- </p>
15
-
16
- <div class="d-flex ga-3">
17
- <v-btn
18
- v-if="status === 'error'"
19
- color="primary"
20
- variant="flat"
21
- class="text-none"
22
- @click="retrySignOut"
23
- >
24
- {{ t("jskit.auth.signOut.retry") }}
25
- </v-btn>
26
- <v-btn
27
- v-if="status === 'error'"
28
- color="secondary"
29
- variant="text"
30
- class="text-none"
31
- @click="goToLogin"
32
- >
33
- {{ t("jskit.auth.signOut.goToLogin") }}
34
- </v-btn>
35
- <v-progress-circular v-if="status === 'pending'" indeterminate color="primary" size="22" />
36
- </div>
37
- </v-card-text>
38
- </v-card>
39
- </v-container>
40
- </v-main>
2
+ <AuthScreen class="signout-screen" :class="{ 'signout-screen--mobile': isMobileViewport }">
3
+ <template v-if="$slots.brand" #brand="brand">
4
+ <slot name="brand" v-bind="brand" />
5
+ </template>
6
+ <v-card
7
+ class="signout-card"
8
+ :class="{ 'signout-card--mobile': isMobileViewport }"
9
+ variant="flat"
10
+ :rounded="isMobileViewport ? false : undefined"
11
+ >
12
+ <v-card-text class="signout-content" :class="{ 'signout-content--mobile': isMobileViewport }">
13
+ <h1 class="signout-title text-headline-medium mb-3">{{ t("jskit.auth.signOut.title") }}</h1>
14
+
15
+ <p v-if="status === 'pending'" class="on-surface-variant mb-4">
16
+ {{ t("jskit.auth.signOut.pending") }}
17
+ </p>
18
+
19
+ <p v-if="status === 'error'" class="text-body-large on-surface-variant mb-4">
20
+ {{ errorMessage || t("jskit.auth.signOut.failedTryAgain") }}
21
+ </p>
22
+
23
+ <div class="d-flex ga-3">
24
+ <v-btn
25
+ v-if="status === 'error'"
26
+ color="primary"
27
+ variant="flat"
28
+ class="text-none"
29
+ @click="retrySignOut"
30
+ >
31
+ {{ t("jskit.auth.signOut.retry") }}
32
+ </v-btn>
33
+ <v-btn
34
+ v-if="status === 'error'"
35
+ color="secondary"
36
+ variant="text"
37
+ class="text-none"
38
+ @click="goToLogin"
39
+ >
40
+ {{ t("jskit.auth.signOut.goToLogin") }}
41
+ </v-btn>
42
+ <v-progress-circular v-if="status === 'pending'" indeterminate color="primary" size="22" />
43
+ </div>
44
+ </v-card-text>
45
+ </v-card>
46
+ </AuthScreen>
41
47
  </template>
42
48
 
43
49
  <script setup>
50
+ import { useDisplay } from "vuetify";
51
+ import AuthScreen from "./AuthScreen.vue";
44
52
  import { useDefaultSignOutView } from "../composables/useDefaultSignOutView.js";
45
53
  import { useJskitText } from "../i18n.js";
46
54
 
55
+ const { mobile: isMobileViewport } = useDisplay({ mobileBreakpoint: 960 });
47
56
  const { t } = useJskitText();
48
57
  const { status, errorMessage, retrySignOut, goToLogin } = useDefaultSignOutView();
49
58
  </script>
50
59
 
51
60
  <style scoped>
52
- .signout-main {
53
- background-color: rgb(var(--v-theme-surface-container));
54
- }
55
-
56
61
  .signout-card {
57
62
  width: min(520px, 100%);
58
63
  }
64
+
65
+ /* On a phone the card is the screen below the brand row, if any. */
66
+ .signout-card--mobile {
67
+ flex: 1 0 auto;
68
+ width: 100%;
69
+ }
70
+
71
+ .signout-content {
72
+ padding: 28px;
73
+ }
74
+
75
+ .signout-content--mobile {
76
+ padding: calc(24px + var(--auth-screen-top-inset, 0px)) 20px calc(32px + env(safe-area-inset-bottom, 0px));
77
+ }
59
78
  </style>
@@ -1,13 +1,8 @@
1
1
  import { DEV_AUTH_SECRET_HEADER } from "@jskit-ai/auth-core/server/devAuth";
2
2
  import { AUTH_PATHS } from "@jskit-ai/auth-core/shared/authPaths";
3
3
 
4
- function defaultLocalBaseUrl() {
5
- const port = String(process.env.PLAYWRIGHT_PORT || "").trim() || "4173";
6
- return `http://127.0.0.1:${port}`;
7
- }
8
-
9
4
  function resolveLocalBaseUrl(value) {
10
- const baseUrl = String(value || defaultLocalBaseUrl()).trim().replace(/\/+$/u, "");
5
+ const baseUrl = String(value).trim().replace(/\/+$/u, "");
11
6
  let url;
12
7
  try {
13
8
  url = new URL(baseUrl);
@@ -41,15 +36,22 @@ async function responseBody(response) {
41
36
  return body ? ` ${body}` : "";
42
37
  }
43
38
 
44
- async function loginAsExistingUser(page, {
39
+ /**
40
+ * Signs `request`, a Playwright APIRequestContext, in as an existing user through the local app's dev-auth route: a
41
+ * page context's `request`, or the one a browserTestConfig() `signIn` module is given to sign a worker in once. Without
42
+ * `baseURL`, it signs in on the context's own baseURL: under browserTestConfig() each worker's own server. The private
43
+ * secret is only ever sent to a local app URL; a managed target (PLAYWRIGHT_BASE_URL) is refused before any request.
44
+ * @param {import("@playwright/test").APIRequestContext} request
45
+ * @param {{ email?: string, userId?: string, secret?: string, baseURL?: string }} [options]
46
+ */
47
+ async function loginRequestAsExistingUser(request, {
45
48
  email = "",
46
49
  userId = "",
47
50
  secret = process.env.AUTH_DEV_BYPASS_SECRET,
48
- baseURL = process.env.PLAYWRIGHT_BASE_URL || defaultLocalBaseUrl()
51
+ baseURL = ""
49
52
  } = {}) {
50
- const context = page?.context?.();
51
- if (!context?.request) {
52
- throw new Error("loginAsExistingUser requires a Playwright page.");
53
+ if (typeof request?.get !== "function") {
54
+ throw new Error("loginRequestAsExistingUser requires a Playwright APIRequestContext.");
53
55
  }
54
56
 
55
57
  const normalizedSecret = String(secret || "").trim();
@@ -57,12 +59,18 @@ async function loginAsExistingUser(page, {
57
59
  throw new Error("loginAsExistingUser requires AUTH_DEV_BYPASS_SECRET.");
58
60
  }
59
61
 
60
- const localBaseUrl = resolveLocalBaseUrl(baseURL);
62
+ const givenBaseUrl = baseURL ? resolveLocalBaseUrl(baseURL) : "";
63
+ if (!givenBaseUrl && process.env.PLAYWRIGHT_BASE_URL) {
64
+ resolveLocalBaseUrl(process.env.PLAYWRIGHT_BASE_URL);
65
+ }
61
66
  const identity = resolveIdentity({ email, userId });
62
- const sessionResponse = await context.request.get(`${localBaseUrl}${AUTH_PATHS.SESSION}`);
67
+ // A path alone resolves against the context's own baseURL.
68
+ const sessionResponse = await request.get(`${givenBaseUrl}${AUTH_PATHS.SESSION}`);
63
69
  if (!sessionResponse.ok()) {
64
70
  throw new Error(`Session bootstrap failed: ${sessionResponse.status()}${await responseBody(sessionResponse)}`);
65
71
  }
72
+ // The secret goes only to the local server that answered the session request.
73
+ const localBaseUrl = givenBaseUrl || resolveLocalBaseUrl(new URL(sessionResponse.url()).origin);
66
74
 
67
75
  const session = await sessionResponse.json();
68
76
  const csrfToken = String(session?.csrfToken || "").trim();
@@ -70,7 +78,7 @@ async function loginAsExistingUser(page, {
70
78
  throw new Error("Session bootstrap did not return csrfToken.");
71
79
  }
72
80
 
73
- const loginResponse = await context.request.post(`${localBaseUrl}${AUTH_PATHS.DEV_LOGIN_AS}`, {
81
+ const loginResponse = await request.post(`${localBaseUrl}${AUTH_PATHS.DEV_LOGIN_AS}`, {
74
82
  data: identity,
75
83
  headers: {
76
84
  "csrf-token": csrfToken,
@@ -84,4 +92,17 @@ async function loginAsExistingUser(page, {
84
92
  return loginResponse.json();
85
93
  }
86
94
 
87
- export { loginAsExistingUser };
95
+ /**
96
+ * Signs `page`'s context in as an existing user, as `loginRequestAsExistingUser()` signs its `request` in.
97
+ * @param {import("@playwright/test").Page} page
98
+ * @param {{ email?: string, userId?: string, secret?: string, baseURL?: string }} [options]
99
+ */
100
+ async function loginAsExistingUser(page, options = {}) {
101
+ const context = page?.context?.();
102
+ if (!context?.request) {
103
+ throw new Error("loginAsExistingUser requires a Playwright page.");
104
+ }
105
+ return loginRequestAsExistingUser(context.request, options);
106
+ }
107
+
108
+ export { loginAsExistingUser, loginRequestAsExistingUser };
@@ -0,0 +1,34 @@
1
+ import assert from "node:assert/strict";
2
+ import { readFile } from "node:fs/promises";
3
+ import test from "node:test";
4
+
5
+ // The auth-surface pattern shows the app's identity on its sign-in, reset and sign-out screens: each page renders the
6
+ // app's view wrapper, and the wrapper fills the default view's brand slot with AppBrand.vue, the app's name.
7
+ const EXAMPLE = new URL("../patterns/auth-surface/example/src/", import.meta.url);
8
+ const SCREENS = Object.freeze([
9
+ { page: "login", view: "LoginView" },
10
+ { page: "reset-password", view: "ResetPasswordView" },
11
+ { page: "signout", view: "SignOutView" }
12
+ ]);
13
+ const read = (relative) => readFile(new URL(relative, EXAMPLE), "utf8");
14
+
15
+ test("the auth-surface pages render the app's view wrappers, which fill the brand slot with AppBrand", async () => {
16
+ for (const { page, view } of SCREENS) {
17
+ const pageSource = await read(`pages/auth/${page}.vue`);
18
+ assert.match(pageSource, new RegExp(`import ${view} from "@/views/auth/${view}\\.vue";`, "u"), `${page}.vue imports the app's wrapper`);
19
+ assert.match(pageSource, new RegExp(`<${view} />`, "u"), `${page}.vue renders the app's wrapper`);
20
+ assert.doesNotMatch(pageSource, /Default\w+View/u, `${page}.vue does not render the default view itself`);
21
+
22
+ const viewSource = await read(`views/auth/${view}.vue`);
23
+ assert.match(viewSource, new RegExp(`import Default${view} from "@jskit-ai/auth-web/client/views/Default${view}";`, "u"));
24
+ assert.match(viewSource, /import AppBrand from "@\/components\/AppBrand\.vue";/u);
25
+ assert.match(viewSource, /<template #brand="\{ compact \}">\s*<AppBrand :compact="compact" \/>\s*<\/template>/u, `${view}.vue fills the brand slot`);
26
+ }
27
+ });
28
+
29
+ test("AppBrand shows the app's name and no heading", async () => {
30
+ const source = await read("components/AppBrand.vue");
31
+ assert.match(source, /const APP_NAME = "Reading Room";/u);
32
+ assert.match(source, /compact \? 'text-title-medium' : 'text-title-large'/u);
33
+ assert.doesNotMatch(source, /<h[1-6]\b/u);
34
+ });
@@ -75,38 +75,39 @@ test("auth profile activator keeps Material 3's 48dp touch target without a fixe
75
75
  const widgetSource = readFileSync(widgetPath, "utf8");
76
76
 
77
77
  assert.match(widgetSource, /class="auth-profile-widget__activator text-none pl-1 pr-2"/);
78
+ // Without the name, up to medium width, the activator is an icon button, so its state layer is a circle round the
79
+ // avatar; the name shows on expanded windows only, through the shell's window size classes.
80
+ assert.match(widgetSource, /const showsName = computed\(\(\) => isExpanded\.value \|\| isLarge\.value\);/u);
81
+ assert.match(widgetSource, /<v-btn v-else v-bind="props" icon variant="text" class="auth-profile-widget__activator" :aria-label="displayName">/u);
78
82
  // material-web gives every default-size button a 48dp touch target around its 40dp body; a fixed height would
79
83
  // make the button itself taller than Material 3 draws it.
80
84
  assert.doesNotMatch(widgetSource, /min-height/u);
81
85
  assert.doesNotMatch(widgetSource, /<v-btn[^>]*auth-profile-widget__activator[^>]*\ssize=/u);
82
86
  });
83
87
 
84
- test("default login view owns the viewport and becomes a full-screen mobile screen", () => {
85
- const viewPath = fileURLToPath(new URL("../src/client/views/DefaultLoginView.vue", import.meta.url));
86
- const viewSource = readFileSync(viewPath, "utf8");
87
-
88
- assert.match(viewSource, /import\s+\{\s*useDisplay\s*\}\s+from\s+"vuetify";/);
89
- assert.match(viewSource, /useDisplay\(\{\s*mobileBreakpoint:\s*960\s*\}\)/);
90
- assert.doesNotMatch(viewSource, /<v-main\b/);
91
- assert.match(viewSource, /login-screen--mobile/);
92
- assert.match(viewSource, /login-shell--mobile/);
93
- assert.match(viewSource, /auth-card--mobile/);
94
- assert.match(viewSource, /auth-content--mobile/);
95
- assert.match(viewSource, /:elevation="isMobileViewport \? 0 : 1"/);
96
- // An elevated Material 3 card on wide windows, the whole screen on phones; never an outlined one.
97
- assert.doesNotMatch(viewSource, /:border=|\sborder(?=[\s>])/);
98
- assert.match(viewSource, /\.login-screen\s*\{[\s\S]*position:\s*fixed;/);
88
+ test("the auth views fill the viewport through AuthScreen: a card on wide windows, the whole screen on phones", () => {
89
+ const read = (name) => readFileSync(fileURLToPath(new URL(`../src/client/views/${name}.vue`, import.meta.url)), "utf8");
90
+ const screen = read("AuthScreen");
91
+ assert.match(screen, /useDisplay\(\{\s*mobileBreakpoint:\s*960\s*\}\)/);
92
+ assert.match(screen, /\.auth-screen\s*\{[\s\S]*position:\s*fixed;/);
99
93
  // The full-viewport screen starts below shell banners shown on this bar-less surface.
100
- assert.match(viewSource, /\.login-screen\s*\{[\s\S]*inset:\s*var\(--shell-error-banners-inline-height, 0px\) 0 0;/);
101
- });
102
-
103
- test("default reset view starts below shell banners on its bar-less surface", () => {
104
- const viewPath = fileURLToPath(new URL("../src/client/views/DefaultResetPasswordView.vue", import.meta.url));
105
- const viewSource = readFileSync(viewPath, "utf8");
106
-
107
- assert.match(viewSource, /\.reset-screen\s*\{[\s\S]*position:\s*fixed;/);
108
- assert.match(viewSource, /\.reset-screen\s*\{[\s\S]*inset:\s*var\(--shell-error-banners-inline-height, 0px\) 0 0;/);
109
- assert.doesNotMatch(viewSource, /min-height:\s*100dvh/);
94
+ assert.match(screen, /\.auth-screen\s*\{[\s\S]*inset:\s*var\(--shell-error-banners-inline-height, 0px\) 0 0;/);
95
+ assert.doesNotMatch(screen, /min-height:\s*100dvh/);
96
+ for (const [name, card] of [["DefaultLoginView", "auth-card"], ["DefaultResetPasswordView", "reset-card"], ["DefaultSignOutView", "signout-card"]]) {
97
+ const view = read(name);
98
+ assert.match(view, /<AuthScreen\b/, name);
99
+ // The app's brand slot reaches the screen's pane and row.
100
+ assert.match(view, /<template v-if="\$slots\.brand" #brand="brand">\s*<slot name="brand" v-bind="brand" \/>/, name);
101
+ assert.doesNotMatch(view, /<v-main\b|position:\s*fixed/, name);
102
+ assert.match(view, new RegExp(`${card}--mobile`), name);
103
+ // One container treatment: the card's tone against the screen, with no shadow or outline over it.
104
+ assert.match(view, /<v-card\b[^>]*\svariant="flat"/, name);
105
+ assert.doesNotMatch(view, /:?elevation=/, name);
106
+ // An elevated Material 3 card on wide windows, the whole screen on phones; never an outlined one.
107
+ assert.doesNotMatch(view, /:border=|\sborder(?=[\s>])/, name);
108
+ // Each has its one h1.
109
+ assert.equal((view.match(/<h1\b/gu) || []).length, 1, name);
110
+ }
110
111
  });
111
112
 
112
113
  test("default login view avoids decorative login chrome", () => {
@@ -117,7 +118,9 @@ test("default login view avoids decorative login chrome", () => {
117
118
 
118
119
  assert.match(viewSource, /v-if="authTitle \|\| authSubtitle"/);
119
120
  assert.doesNotMatch(viewSource, /Jskit Workspace|JSKIT WORKSPACE|auth-kicker|>Secure</);
120
- assert.match(constantsSource, /\[LOGIN_MODE\]:\s*""/);
121
+ // Sign-in has its one h1 ("Sign in") and no tagline.
122
+ assert.match(constantsSource, /AUTH_TITLE_BY_MODE = Object\.freeze\(\{\s*\[LOGIN_MODE\]:\s*"jskit\.auth\.login\.title\.login"/);
123
+ assert.match(constantsSource, /AUTH_SUBTITLE_BY_MODE = Object\.freeze\(\{\s*\[LOGIN_MODE\]:\s*""/);
121
124
  assert.doesNotMatch(constantsSource, /\[LOGIN_MODE\]:\s*"Welcome"/);
122
125
  assert.doesNotMatch(constantsSource, /\[LOGIN_MODE\]:\s*"Sign in to continue\.?"/);
123
126
  });