@things-factory/auth-ui 10.1.192 → 10.1.194

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.
@@ -10,8 +10,11 @@ import { join } from 'path';
10
10
  *
11
11
  * `auth-base/tests/activate-page-case.test.ts` holds the code the server sends; this holds what the
12
12
  * page does with it.
13
+ *
14
+ * It sits here, not beside the page: everything under `entries/` is a webpack entry
15
+ * (`entries-hold-only-pages.test.ts`).
13
16
  */
14
- const page = readFileSync(join(__dirname, 'activate.ts'), 'utf-8');
17
+ const page = readFileSync(join(__dirname, 'entries', 'auth', 'activate.ts'), 'utf-8');
15
18
  describe('the activate page', () => {
16
19
  it('tells a locked account from one not yet confirmed', () => {
17
20
  expect(page).toContain("i18next.t(locked ? 'text.your account is locked' : 'text.your account is not activated')");
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activate-page.test.js","sourceRoot":"","sources":["../client/activate-page.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B;;;;;;;;;;;;;GAaG;AAEH,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,OAAO,CAAC,CAAA;AAErF,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QAC3D,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,0FAA0F,CAAC,CAAA;IACpH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;QACzD,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,2EAA2E,CAAC,CAAA;IACrG,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,iEAAiE,EAAE,GAAG,EAAE;QACzE,MAAM,CAAC,yGAAyG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACzI,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { readFileSync } from 'fs'\nimport { join } from 'path'\n\n/**\n * The activate page says which of its two cases it is in.\n *\n * The server sends a locked account here as well as one not yet confirmed. The page said \"your\n * account is not activated\" to both and offered the activation mail to both. A locked person had\n * already been sent the unlock mail; the activation mail on top was a second, different way back,\n * and nothing on the page said why they were stopped.\n *\n * `auth-base/tests/activate-page-case.test.ts` holds the code the server sends; this holds what the\n * page does with it.\n *\n * It sits here, not beside the page: everything under `entries/` is a webpack entry\n * (`entries-hold-only-pages.test.ts`).\n */\n\nconst page = readFileSync(join(__dirname, 'entries', 'auth', 'activate.ts'), 'utf-8')\n\ndescribe('the activate page', () => {\n it('tells a locked account from one not yet confirmed', () => {\n expect(page).toContain(\"i18next.t(locked ? 'text.your account is locked' : 'text.your account is not activated')\")\n })\n\n it('tells a locked account the unlock mail has gone', () => {\n expect(page).toContain(\"${locked ? html`<p>${i18next.t('text.unlock email sent')}</p>` : nothing}\")\n })\n\n it('offers the activation mail only to an account not yet confirmed', () => {\n expect(/\\$\\{locked\\s*\\?\\s*nothing\\s*:\\s*html`\\s*<md-elevated-button @click=\\$\\{e => this\\.requestResend\\(e\\)\\}>/.test(page)).toBe(true)\n })\n})\n"]}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,25 @@
1
+ import { readdirSync, statSync } from 'fs';
2
+ import { join } from 'path';
3
+ /**
4
+ * Nothing but pages lives under `entries/`.
5
+ *
6
+ * The builder takes every `.js` under a module's `dist-client/entries/` as a webpack entry
7
+ * (`builder/controller/entries-builder.js`), and the client tsconfig compiles every file here. A
8
+ * test placed beside its page was compiled, published in 10.1.192, and made an entry: the
9
+ * production image's `build:app` failed resolving the test's `fs`. The local build runs tsc only,
10
+ * so it did not see it.
11
+ */
12
+ const ENTRIES = join(__dirname, 'entries');
13
+ function filesUnder(dir) {
14
+ return readdirSync(dir).flatMap(entry => {
15
+ const path = join(dir, entry);
16
+ return statSync(path).isDirectory() ? filesUnder(path) : [path];
17
+ });
18
+ }
19
+ it('no test is placed under entries/', () => {
20
+ const tests = filesUnder(ENTRIES)
21
+ .filter(path => /\.(test|spec)\.[jt]s$/.test(path))
22
+ .map(path => path.slice(ENTRIES.length + 1));
23
+ expect(tests).toEqual([]);
24
+ });
25
+ //# sourceMappingURL=entries-hold-only-pages.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entries-hold-only-pages.test.js","sourceRoot":"","sources":["../client/entries-hold-only-pages.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAA;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B;;;;;;;;GAQG;AAEH,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;AAE1C,SAAS,UAAU,CAAC,GAAW;IAC7B,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACtC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;QAE7B,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IACjE,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;IAC1C,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC;SAC9B,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAClD,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAA;IAE9C,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;AAC3B,CAAC,CAAC,CAAA","sourcesContent":["import { readdirSync, statSync } from 'fs'\nimport { join } from 'path'\n\n/**\n * Nothing but pages lives under `entries/`.\n *\n * The builder takes every `.js` under a module's `dist-client/entries/` as a webpack entry\n * (`builder/controller/entries-builder.js`), and the client tsconfig compiles every file here. A\n * test placed beside its page was compiled, published in 10.1.192, and made an entry: the\n * production image's `build:app` failed resolving the test's `fs`. The local build runs tsc only,\n * so it did not see it.\n */\n\nconst ENTRIES = join(__dirname, 'entries')\n\nfunction filesUnder(dir: string): string[] {\n return readdirSync(dir).flatMap(entry => {\n const path = join(dir, entry)\n\n return statSync(path).isDirectory() ? filesUnder(path) : [path]\n })\n}\n\nit('no test is placed under entries/', () => {\n const tests = filesUnder(ENTRIES)\n .filter(path => /\\.(test|spec)\\.[jt]s$/.test(path))\n .map(path => path.slice(ENTRIES.length + 1))\n\n expect(tests).toEqual([])\n})\n"]}