@verdaccio/e2e-ui 2.2.0 → 2.3.0

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.
Files changed (41) hide show
  1. package/build/cjs/features.cjs +64 -0
  2. package/build/cjs/features.cjs.map +1 -0
  3. package/build/cjs/index.cjs +5 -1
  4. package/build/cjs/index.cjs.map +1 -1
  5. package/build/cjs/testIds.cjs +16 -1
  6. package/build/cjs/testIds.cjs.map +1 -1
  7. package/build/cjs/tests/home.cjs +3 -1
  8. package/build/cjs/tests/home.cjs.map +1 -1
  9. package/build/cjs/tests/layout.cjs +10 -0
  10. package/build/cjs/tests/layout.cjs.map +1 -1
  11. package/build/cjs/tests/publish.cjs +25 -2
  12. package/build/cjs/tests/publish.cjs.map +1 -1
  13. package/build/cjs/tests/search.cjs +48 -0
  14. package/build/cjs/tests/search.cjs.map +1 -1
  15. package/build/cjs/tests/settings.cjs +3 -1
  16. package/build/cjs/tests/settings.cjs.map +1 -1
  17. package/build/cjs/tests/signin.cjs +25 -3
  18. package/build/cjs/tests/signin.cjs.map +1 -1
  19. package/build/esm/features.js +62 -0
  20. package/build/esm/features.js.map +1 -0
  21. package/build/esm/index.js +4 -2
  22. package/build/esm/index.js.map +1 -1
  23. package/build/esm/testIds.js +16 -1
  24. package/build/esm/testIds.js.map +1 -1
  25. package/build/esm/tests/home.js +3 -1
  26. package/build/esm/tests/home.js.map +1 -1
  27. package/build/esm/tests/layout.js +10 -0
  28. package/build/esm/tests/layout.js.map +1 -1
  29. package/build/esm/tests/publish.js +25 -2
  30. package/build/esm/tests/publish.js.map +1 -1
  31. package/build/esm/tests/search.js +48 -0
  32. package/build/esm/tests/search.js.map +1 -1
  33. package/build/esm/tests/settings.js +3 -1
  34. package/build/esm/tests/settings.js.map +1 -1
  35. package/build/esm/tests/signin.js +25 -3
  36. package/build/esm/tests/signin.js.map +1 -1
  37. package/build/features.d.ts +94 -0
  38. package/build/index.d.ts +2 -0
  39. package/build/testIds.d.ts +28 -0
  40. package/build/types.d.ts +8 -0
  41. package/package.json +1 -1
@@ -0,0 +1,64 @@
1
+ //#region src/features.ts
2
+ /** Defaults: all flags on. */
3
+ var DEFAULT_FEATURES = {
4
+ search: {
5
+ resultsDropdown: true,
6
+ resultClickNavigation: true
7
+ },
8
+ home: { publishedPackageRendering: true },
9
+ settings: { languageSwitcher: true },
10
+ signin: { validationTests: true },
11
+ layout: { themeSwitch: true },
12
+ publish: {
13
+ downloadTarball: true,
14
+ rawViewer: true
15
+ }
16
+ };
17
+ /**
18
+ * Merge user overrides into the default feature flags. Per-section,
19
+ * one level deep — matching the style of `mergeTestIds`.
20
+ */
21
+ function mergeFeatures(defaults, overrides) {
22
+ if (!overrides) return defaults;
23
+ return {
24
+ search: {
25
+ ...defaults.search,
26
+ ...overrides.search
27
+ },
28
+ home: {
29
+ ...defaults.home,
30
+ ...overrides.home
31
+ },
32
+ settings: {
33
+ ...defaults.settings,
34
+ ...overrides.settings
35
+ },
36
+ signin: {
37
+ ...defaults.signin,
38
+ ...overrides.signin
39
+ },
40
+ layout: {
41
+ ...defaults.layout,
42
+ ...overrides.layout
43
+ },
44
+ publish: {
45
+ ...defaults.publish,
46
+ ...overrides.publish
47
+ }
48
+ };
49
+ }
50
+ /**
51
+ * Helper that returns either `it` or `it.skip` depending on an
52
+ * enabled flag. Usage:
53
+ *
54
+ * maybeIt(features.search.resultsDropdown)('…', () => { … });
55
+ */
56
+ function maybeIt(enabled) {
57
+ return enabled ? it : it.skip;
58
+ }
59
+ //#endregion
60
+ exports.DEFAULT_FEATURES = DEFAULT_FEATURES;
61
+ exports.maybeIt = maybeIt;
62
+ exports.mergeFeatures = mergeFeatures;
63
+
64
+ //# sourceMappingURL=features.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features.cjs","names":[],"sources":["../../src/features.ts"],"sourcesContent":["/**\n * Per-test feature flags for enabling/disabling individual test cases\n * in the e2e-ui suites.\n *\n * The Verdaccio UI behaves differently across branches — search result\n * payload shape differs between the `/-/v1/search` and\n * `/-/verdaccio/data/search/*` endpoints, the language picker was\n * added in a specific minor, etc. Rather than forking the suite per\n * branch, consumers can disable individual tests via\n * `createRegistryConfig({ features: { … } })`.\n *\n * Every flag defaults to `true` (test runs). Override to `false` to\n * convert the test into a Mocha `it.skip` call — the suite still\n * reports the test but marks it as pending.\n */\nexport interface Features {\n search: {\n /**\n * Whether to run the \"results dropdown renders a matching\n * package\" test. Disable on builds where the search result shape\n * or the Autocomplete rendering differs from the default assumption.\n */\n resultsDropdown: boolean;\n /**\n * Whether to run the \"clicking a result navigates to detail\" test.\n * Depends on the Autocomplete `onSelectItem` → router wiring.\n */\n resultClickNavigation: boolean;\n };\n home: {\n /**\n * Whether to run the `with a published package` sub-block inside\n * `homeTests` (publishes a throwaway package and asserts it\n * renders in the package list).\n */\n publishedPackageRendering: boolean;\n };\n settings: {\n /**\n * Whether to run the \"change language via card click\" test.\n * Depends on the `LanguageSwitch` component layout and its\n * translation sentinels (\"Translations\", \"German\"). Skip on\n * builds that lag behind the upstream translation file.\n */\n languageSwitcher: boolean;\n };\n signin: {\n /**\n * Whether to run the three validation tests (disabled submit\n * button, invalid credentials error banner). Depends on the\n * current yup schema and the hard-coded \"Invalid username or\n * password\" error string.\n */\n validationTests: boolean;\n };\n layout: {\n /**\n * Whether to run the dark/light theme switch test. Depends on\n * `web.showThemeSwitch` (defaults to true in ui-theme) and the\n * `header--button--light` / `header--button--dark` testids.\n */\n themeSwitch: boolean;\n };\n publish: {\n /**\n * Whether to run the \"tarball download button fires a GET\" test.\n * Depends on `web.showDownloadTarball` (defaults to true) and\n * the published package manifest having a valid `dist.tarball`.\n */\n downloadTarball: boolean;\n /**\n * Whether to run the \"raw viewer dialog opens + closes\" test.\n * Depends on `web.showRaw` (defaults to true).\n */\n rawViewer: boolean;\n };\n}\n\n/** Defaults: all flags on. */\nexport const DEFAULT_FEATURES: Features = {\n search: {\n resultsDropdown: true,\n resultClickNavigation: true,\n },\n home: {\n publishedPackageRendering: true,\n },\n settings: {\n languageSwitcher: true,\n },\n signin: {\n validationTests: true,\n },\n layout: {\n themeSwitch: true,\n },\n publish: {\n downloadTarball: true,\n rawViewer: true,\n },\n};\n\nimport type { DeepPartial } from './testIds';\n\n/**\n * Merge user overrides into the default feature flags. Per-section,\n * one level deep — matching the style of `mergeTestIds`.\n */\nexport function mergeFeatures(\n defaults: Features,\n overrides?: DeepPartial<Features>\n): Features {\n if (!overrides) return defaults;\n return {\n search: { ...defaults.search, ...overrides.search },\n home: { ...defaults.home, ...overrides.home },\n settings: { ...defaults.settings, ...overrides.settings },\n signin: { ...defaults.signin, ...overrides.signin },\n layout: { ...defaults.layout, ...overrides.layout },\n publish: { ...defaults.publish, ...overrides.publish },\n };\n}\n\n/**\n * Helper that returns either `it` or `it.skip` depending on an\n * enabled flag. Usage:\n *\n * maybeIt(features.search.resultsDropdown)('…', () => { … });\n */\nexport function maybeIt(enabled: boolean): Mocha.TestFunction | Mocha.PendingTestFunction {\n return enabled ? it : it.skip;\n}\n"],"mappings":";;AA+EA,IAAa,mBAA6B;CACxC,QAAQ;EACN,iBAAiB;EACjB,uBAAuB;EACxB;CACD,MAAM,EACJ,2BAA2B,MAC5B;CACD,UAAU,EACR,kBAAkB,MACnB;CACD,QAAQ,EACN,iBAAiB,MAClB;CACD,QAAQ,EACN,aAAa,MACd;CACD,SAAS;EACP,iBAAiB;EACjB,WAAW;EACZ;CACF;;;;;AAQD,SAAgB,cACd,UACA,WACU;AACV,KAAI,CAAC,UAAW,QAAO;AACvB,QAAO;EACL,QAAQ;GAAE,GAAG,SAAS;GAAQ,GAAG,UAAU;GAAQ;EACnD,MAAM;GAAE,GAAG,SAAS;GAAM,GAAG,UAAU;GAAM;EAC7C,UAAU;GAAE,GAAG,SAAS;GAAU,GAAG,UAAU;GAAU;EACzD,QAAQ;GAAE,GAAG,SAAS;GAAQ,GAAG,UAAU;GAAQ;EACnD,QAAQ;GAAE,GAAG,SAAS;GAAQ,GAAG,UAAU;GAAQ;EACnD,SAAS;GAAE,GAAG,SAAS;GAAS,GAAG,UAAU;GAAS;EACvD;;;;;;;;AASH,SAAgB,QAAQ,SAAkE;AACxF,QAAO,UAAU,KAAK,GAAG"}
@@ -1,5 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_publish = require("./tasks/publish.cjs");
3
+ const require_features = require("./features.cjs");
3
4
  const require_testIds = require("./testIds.cjs");
4
5
  const require_home = require("./tests/home.cjs");
5
6
  const require_signin = require("./tests/signin.cjs");
@@ -33,7 +34,8 @@ function createRegistryConfig(options) {
33
34
  },
34
35
  title: options.title ?? "Verdaccio",
35
36
  testIds: require_testIds.mergeTestIds(require_testIds.DEFAULT_TEST_IDS, options.testIds),
36
- selectors: require_testIds.mergeSelectors(require_testIds.DEFAULT_SELECTORS, options.selectors)
37
+ selectors: require_testIds.mergeSelectors(require_testIds.DEFAULT_SELECTORS, options.selectors),
38
+ features: require_features.mergeFeatures(require_features.DEFAULT_FEATURES, options.features)
37
39
  };
38
40
  }
39
41
  /**
@@ -110,12 +112,14 @@ function registerAllTests(config) {
110
112
  require_publish$1.publishTests(config);
111
113
  }
112
114
  //#endregion
115
+ exports.DEFAULT_FEATURES = require_features.DEFAULT_FEATURES;
113
116
  exports.DEFAULT_SELECTORS = require_testIds.DEFAULT_SELECTORS;
114
117
  exports.DEFAULT_TEST_IDS = require_testIds.DEFAULT_TEST_IDS;
115
118
  exports.cleanupPublished = require_publish.cleanupPublished;
116
119
  exports.createRegistryConfig = createRegistryConfig;
117
120
  exports.homeTests = require_home.homeTests;
118
121
  exports.layoutTests = require_layout.layoutTests;
122
+ exports.maybeIt = require_features.maybeIt;
119
123
  exports.publishPackage = require_publish.publishPackage;
120
124
  exports.publishTests = require_publish$1.publishTests;
121
125
  exports.registerAllTests = registerAllTests;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import {\n cleanupPublished,\n publishPackage,\n PublishPackageResult,\n PublishPackageTaskInput,\n unpublishPackage,\n UnpublishPackageInput,\n UnpublishPackageResult,\n} from './tasks';\nimport {\n DEFAULT_SELECTORS,\n DEFAULT_TEST_IDS,\n mergeSelectors,\n mergeTestIds,\n} from './testIds';\nimport { RegistryConfig, RegistryTaskResult, VerdaccioUiOptions } from './types';\n\nexport type {\n RegistryConfig,\n RegistryTaskResult,\n VerdaccioUiOptions,\n} from './types';\nexport type {\n PublishPackageInput,\n PublishPackageTaskInput,\n PublishPackageResult,\n UnpublishPackageInput,\n UnpublishPackageResult,\n} from './tasks';\nexport type { DeepPartial, Selectors, TestIds } from './testIds';\nexport { DEFAULT_SELECTORS, DEFAULT_TEST_IDS } from './testIds';\nexport { publishPackage, cleanupPublished, unpublishPackage } from './tasks';\nexport {\n homeTests,\n signinTests,\n publishTests,\n searchTests,\n settingsTests,\n layoutTests,\n} from './tests';\n\n/**\n * Build a full RegistryConfig from user-provided options with defaults.\n *\n * `testIds` and `selectors` are deep-merged per section with the\n * defaults in `./testIds`. Consumers targeting a non-default Verdaccio\n * build can override just the fields that drifted:\n *\n * createRegistryConfig({\n * registryUrl: 'http://localhost:4873',\n * testIds: {\n * header: { settingsTooltip: 'my-new-settings-btn' },\n * },\n * });\n */\nexport function createRegistryConfig(options: VerdaccioUiOptions): RegistryConfig {\n const url = new URL(options.registryUrl);\n return {\n registryUrl: options.registryUrl,\n port: options.port ?? (parseInt(url.port, 10) || 4873),\n credentials: options.credentials ?? { user: 'test', password: 'test' },\n title: options.title ?? 'Verdaccio',\n testIds: mergeTestIds(DEFAULT_TEST_IDS, options.testIds),\n selectors: mergeSelectors(DEFAULT_SELECTORS, options.selectors),\n };\n}\n\n/**\n * Register Verdaccio Cypress tasks in setupNodeEvents.\n *\n * Usage in cypress.config.ts:\n * import { setupVerdaccioTasks } from '@verdaccio/e2e-ui';\n *\n * export default defineConfig({\n * e2e: {\n * setupNodeEvents(on) {\n * setupVerdaccioTasks(on, { registryUrl: 'http://localhost:4873' });\n * },\n * },\n * });\n */\nexport function setupVerdaccioTasks(\n on: Cypress.PluginEvents,\n options: VerdaccioUiOptions\n): void {\n const config = createRegistryConfig(options);\n\n on('task', {\n registry(): RegistryTaskResult {\n return {\n registryUrl: config.registryUrl,\n port: config.port,\n };\n },\n /**\n * Publish a throwaway package to the registry.\n *\n * Usage from a Cypress spec:\n *\n * cy.task('publishPackage', { pkgName: '@verdaccio/pkg-scoped' });\n *\n * Any field not provided falls back to the values configured here\n * (registryUrl, credentials). The task returns a PublishPackageResult.\n */\n async publishPackage(\n input: PublishPackageTaskInput\n ): Promise<PublishPackageResult> {\n return publishPackage({\n registryUrl: input.registryUrl ?? config.registryUrl,\n credentials: input.credentials ?? config.credentials,\n pkgName: input.pkgName,\n version: input.version,\n dependencies: input.dependencies,\n devDependencies: input.devDependencies,\n unique: input.unique,\n });\n },\n /**\n * Remove a temp project folder returned by a previous publishPackage\n * call. Returns null (Cypress tasks must return something serializable).\n *\n * cy.task('cleanupPublished', result.tempFolder);\n */\n async cleanupPublished(tempFolder: string): Promise<null> {\n await cleanupPublished(tempFolder);\n return null;\n },\n /**\n * Unpublish a package from the registry so the next test starts\n * from a clean slate. Accepts either a package name or a full input\n * object (to reuse a prior tempFolder's token).\n *\n * cy.task('unpublishPackage', '@verdaccio/pkg-scoped');\n * cy.task('unpublishPackage', { pkgName, tempFolder });\n */\n async unpublishPackage(\n input: string | (Omit<UnpublishPackageInput, 'registryUrl'> & {\n registryUrl?: string;\n })\n ): Promise<UnpublishPackageResult> {\n const normalized =\n typeof input === 'string'\n ? { pkgName: input, registryUrl: config.registryUrl }\n : { ...input, registryUrl: input.registryUrl ?? config.registryUrl };\n return unpublishPackage(normalized);\n },\n });\n}\n\n/**\n * Register all Verdaccio UI tests.\n *\n * Usage in a spec file:\n * import { registerAllTests, createRegistryConfig } from '@verdaccio/e2e-ui';\n *\n * const config = createRegistryConfig({ registryUrl: 'http://localhost:4873' });\n * registerAllTests(config);\n *\n * Or pick individual suites:\n * import { homeTests, signinTests } from '@verdaccio/e2e-ui';\n *\n * const config = createRegistryConfig({ registryUrl: 'http://localhost:4873' });\n * homeTests(config);\n * signinTests(config);\n */\nexport function registerAllTests(config: RegistryConfig): void {\n homeTests(config);\n signinTests(config);\n layoutTests(config);\n searchTests(config);\n settingsTests(config);\n publishTests(config);\n}\n\n// Re-export for convenience\nimport {\n homeTests,\n signinTests,\n publishTests,\n searchTests,\n settingsTests,\n layoutTests,\n} from './tests';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAuDA,SAAgB,qBAAqB,SAA6C;CAChF,MAAM,MAAM,IAAI,IAAI,QAAQ,YAAY;AACxC,QAAO;EACL,aAAa,QAAQ;EACrB,MAAM,QAAQ,SAAS,SAAS,IAAI,MAAM,GAAG,IAAI;EACjD,aAAa,QAAQ,eAAe;GAAE,MAAM;GAAQ,UAAU;GAAQ;EACtE,OAAO,QAAQ,SAAS;EACxB,SAAS,gBAAA,aAAa,gBAAA,kBAAkB,QAAQ,QAAQ;EACxD,WAAW,gBAAA,eAAe,gBAAA,mBAAmB,QAAQ,UAAU;EAChE;;;;;;;;;;;;;;;;AAiBH,SAAgB,oBACd,IACA,SACM;CACN,MAAM,SAAS,qBAAqB,QAAQ;AAE5C,IAAG,QAAQ;EACT,WAA+B;AAC7B,UAAO;IACL,aAAa,OAAO;IACpB,MAAM,OAAO;IACd;;EAYH,MAAM,eACJ,OAC+B;AAC/B,UAAO,gBAAA,eAAe;IACpB,aAAa,MAAM,eAAe,OAAO;IACzC,aAAa,MAAM,eAAe,OAAO;IACzC,SAAS,MAAM;IACf,SAAS,MAAM;IACf,cAAc,MAAM;IACpB,iBAAiB,MAAM;IACvB,QAAQ,MAAM;IACf,CAAC;;EAQJ,MAAM,iBAAiB,YAAmC;AACxD,SAAM,gBAAA,iBAAiB,WAAW;AAClC,UAAO;;EAUT,MAAM,iBACJ,OAGiC;AAKjC,UAAO,gBAAA,iBAHL,OAAO,UAAU,WACb;IAAE,SAAS;IAAO,aAAa,OAAO;IAAa,GACnD;IAAE,GAAG;IAAO,aAAa,MAAM,eAAe,OAAO;IAAa,CACrC;;EAEtC,CAAC;;;;;;;;;;;;;;;;;;AAmBJ,SAAgB,iBAAiB,QAA8B;AAC7D,cAAA,UAAU,OAAO;AACjB,gBAAA,YAAY,OAAO;AACnB,gBAAA,YAAY,OAAO;AACnB,gBAAA,YAAY,OAAO;AACnB,kBAAA,cAAc,OAAO;AACrB,mBAAA,aAAa,OAAO"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import {\n cleanupPublished,\n publishPackage,\n PublishPackageResult,\n PublishPackageTaskInput,\n unpublishPackage,\n UnpublishPackageInput,\n UnpublishPackageResult,\n} from './tasks';\nimport { DEFAULT_FEATURES, mergeFeatures } from './features';\nimport {\n DEFAULT_SELECTORS,\n DEFAULT_TEST_IDS,\n mergeSelectors,\n mergeTestIds,\n} from './testIds';\nimport { RegistryConfig, RegistryTaskResult, VerdaccioUiOptions } from './types';\n\nexport type {\n RegistryConfig,\n RegistryTaskResult,\n VerdaccioUiOptions,\n} from './types';\nexport type {\n PublishPackageInput,\n PublishPackageTaskInput,\n PublishPackageResult,\n UnpublishPackageInput,\n UnpublishPackageResult,\n} from './tasks';\nexport type { DeepPartial, Selectors, TestIds } from './testIds';\nexport type { Features } from './features';\nexport { DEFAULT_SELECTORS, DEFAULT_TEST_IDS } from './testIds';\nexport { DEFAULT_FEATURES, maybeIt } from './features';\nexport { publishPackage, cleanupPublished, unpublishPackage } from './tasks';\nexport {\n homeTests,\n signinTests,\n publishTests,\n searchTests,\n settingsTests,\n layoutTests,\n} from './tests';\n\n/**\n * Build a full RegistryConfig from user-provided options with defaults.\n *\n * `testIds` and `selectors` are deep-merged per section with the\n * defaults in `./testIds`. Consumers targeting a non-default Verdaccio\n * build can override just the fields that drifted:\n *\n * createRegistryConfig({\n * registryUrl: 'http://localhost:4873',\n * testIds: {\n * header: { settingsTooltip: 'my-new-settings-btn' },\n * },\n * });\n */\nexport function createRegistryConfig(options: VerdaccioUiOptions): RegistryConfig {\n const url = new URL(options.registryUrl);\n return {\n registryUrl: options.registryUrl,\n port: options.port ?? (parseInt(url.port, 10) || 4873),\n credentials: options.credentials ?? { user: 'test', password: 'test' },\n title: options.title ?? 'Verdaccio',\n testIds: mergeTestIds(DEFAULT_TEST_IDS, options.testIds),\n selectors: mergeSelectors(DEFAULT_SELECTORS, options.selectors),\n features: mergeFeatures(DEFAULT_FEATURES, options.features),\n };\n}\n\n/**\n * Register Verdaccio Cypress tasks in setupNodeEvents.\n *\n * Usage in cypress.config.ts:\n * import { setupVerdaccioTasks } from '@verdaccio/e2e-ui';\n *\n * export default defineConfig({\n * e2e: {\n * setupNodeEvents(on) {\n * setupVerdaccioTasks(on, { registryUrl: 'http://localhost:4873' });\n * },\n * },\n * });\n */\nexport function setupVerdaccioTasks(\n on: Cypress.PluginEvents,\n options: VerdaccioUiOptions\n): void {\n const config = createRegistryConfig(options);\n\n on('task', {\n registry(): RegistryTaskResult {\n return {\n registryUrl: config.registryUrl,\n port: config.port,\n };\n },\n /**\n * Publish a throwaway package to the registry.\n *\n * Usage from a Cypress spec:\n *\n * cy.task('publishPackage', { pkgName: '@verdaccio/pkg-scoped' });\n *\n * Any field not provided falls back to the values configured here\n * (registryUrl, credentials). The task returns a PublishPackageResult.\n */\n async publishPackage(\n input: PublishPackageTaskInput\n ): Promise<PublishPackageResult> {\n return publishPackage({\n registryUrl: input.registryUrl ?? config.registryUrl,\n credentials: input.credentials ?? config.credentials,\n pkgName: input.pkgName,\n version: input.version,\n dependencies: input.dependencies,\n devDependencies: input.devDependencies,\n unique: input.unique,\n });\n },\n /**\n * Remove a temp project folder returned by a previous publishPackage\n * call. Returns null (Cypress tasks must return something serializable).\n *\n * cy.task('cleanupPublished', result.tempFolder);\n */\n async cleanupPublished(tempFolder: string): Promise<null> {\n await cleanupPublished(tempFolder);\n return null;\n },\n /**\n * Unpublish a package from the registry so the next test starts\n * from a clean slate. Accepts either a package name or a full input\n * object (to reuse a prior tempFolder's token).\n *\n * cy.task('unpublishPackage', '@verdaccio/pkg-scoped');\n * cy.task('unpublishPackage', { pkgName, tempFolder });\n */\n async unpublishPackage(\n input: string | (Omit<UnpublishPackageInput, 'registryUrl'> & {\n registryUrl?: string;\n })\n ): Promise<UnpublishPackageResult> {\n const normalized =\n typeof input === 'string'\n ? { pkgName: input, registryUrl: config.registryUrl }\n : { ...input, registryUrl: input.registryUrl ?? config.registryUrl };\n return unpublishPackage(normalized);\n },\n });\n}\n\n/**\n * Register all Verdaccio UI tests.\n *\n * Usage in a spec file:\n * import { registerAllTests, createRegistryConfig } from '@verdaccio/e2e-ui';\n *\n * const config = createRegistryConfig({ registryUrl: 'http://localhost:4873' });\n * registerAllTests(config);\n *\n * Or pick individual suites:\n * import { homeTests, signinTests } from '@verdaccio/e2e-ui';\n *\n * const config = createRegistryConfig({ registryUrl: 'http://localhost:4873' });\n * homeTests(config);\n * signinTests(config);\n */\nexport function registerAllTests(config: RegistryConfig): void {\n homeTests(config);\n signinTests(config);\n layoutTests(config);\n searchTests(config);\n settingsTests(config);\n publishTests(config);\n}\n\n// Re-export for convenience\nimport {\n homeTests,\n signinTests,\n publishTests,\n searchTests,\n settingsTests,\n layoutTests,\n} from './tests';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0DA,SAAgB,qBAAqB,SAA6C;CAChF,MAAM,MAAM,IAAI,IAAI,QAAQ,YAAY;AACxC,QAAO;EACL,aAAa,QAAQ;EACrB,MAAM,QAAQ,SAAS,SAAS,IAAI,MAAM,GAAG,IAAI;EACjD,aAAa,QAAQ,eAAe;GAAE,MAAM;GAAQ,UAAU;GAAQ;EACtE,OAAO,QAAQ,SAAS;EACxB,SAAS,gBAAA,aAAa,gBAAA,kBAAkB,QAAQ,QAAQ;EACxD,WAAW,gBAAA,eAAe,gBAAA,mBAAmB,QAAQ,UAAU;EAC/D,UAAU,iBAAA,cAAc,iBAAA,kBAAkB,QAAQ,SAAS;EAC5D;;;;;;;;;;;;;;;;AAiBH,SAAgB,oBACd,IACA,SACM;CACN,MAAM,SAAS,qBAAqB,QAAQ;AAE5C,IAAG,QAAQ;EACT,WAA+B;AAC7B,UAAO;IACL,aAAa,OAAO;IACpB,MAAM,OAAO;IACd;;EAYH,MAAM,eACJ,OAC+B;AAC/B,UAAO,gBAAA,eAAe;IACpB,aAAa,MAAM,eAAe,OAAO;IACzC,aAAa,MAAM,eAAe,OAAO;IACzC,SAAS,MAAM;IACf,SAAS,MAAM;IACf,cAAc,MAAM;IACpB,iBAAiB,MAAM;IACvB,QAAQ,MAAM;IACf,CAAC;;EAQJ,MAAM,iBAAiB,YAAmC;AACxD,SAAM,gBAAA,iBAAiB,WAAW;AAClC,UAAO;;EAUT,MAAM,iBACJ,OAGiC;AAKjC,UAAO,gBAAA,iBAHL,OAAO,UAAU,WACb;IAAE,SAAS;IAAO,aAAa,OAAO;IAAa,GACnD;IAAE,GAAG;IAAO,aAAa,MAAM,eAAe,OAAO;IAAa,CACrC;;EAEtC,CAAC;;;;;;;;;;;;;;;;;;AAmBJ,SAAgB,iBAAiB,QAA8B;AAC7D,cAAA,UAAU,OAAO;AACjB,gBAAA,YAAY,OAAO;AACnB,gBAAA,YAAY,OAAO;AACnB,gBAAA,YAAY,OAAO;AACnB,kBAAA,cAAc,OAAO;AACrB,mBAAA,aAAa,OAAO"}
@@ -18,6 +18,8 @@ var DEFAULT_TEST_IDS = {
18
18
  loginButton: "header--button-login",
19
19
  settingsTooltip: "header--tooltip-settings",
20
20
  infoTooltip: "header--tooltip-info",
21
+ themeSwitchLight: "header--button--light",
22
+ themeSwitchDark: "header--button--dark",
21
23
  logInDialogIcon: "logInDialogIcon",
22
24
  logOutDialogIcon: "logOutDialogIcon",
23
25
  greetingsLabel: "greetings-label"
@@ -26,6 +28,11 @@ var DEFAULT_TEST_IDS = {
26
28
  container: "footer",
27
29
  version: "version-footer"
28
30
  },
31
+ login: {
32
+ dialog: "login--dialog",
33
+ dialogContent: "dialogContentLogin",
34
+ error: "error"
35
+ },
29
36
  package: {
30
37
  itemList: "package-item-list",
31
38
  title: "package-title",
@@ -41,7 +48,11 @@ var DEFAULT_TEST_IDS = {
41
48
  versionsTab: "versions-tab",
42
49
  tagLatest: "tag-latest",
43
50
  uplinksTab: "uplinks-tab",
44
- noUplinks: "no-uplinks"
51
+ noUplinks: "no-uplinks",
52
+ downloadTarballBtn: "download-tarball-btn",
53
+ rawBtn: "raw-btn",
54
+ rawViewerDialog: "rawViewer--dialog",
55
+ closeRawViewer: "close-raw-viewer"
45
56
  }
46
57
  };
47
58
  /**
@@ -78,6 +89,10 @@ function mergeTestIds(defaults, overrides) {
78
89
  ...defaults.footer,
79
90
  ...overrides.footer
80
91
  },
92
+ login: {
93
+ ...defaults.login,
94
+ ...overrides.login
95
+ },
81
96
  package: {
82
97
  ...defaults.package,
83
98
  ...overrides.package
@@ -1 +1 @@
1
- {"version":3,"file":"testIds.cjs","names":[],"sources":["../../src/testIds.ts"],"sourcesContent":["/**\n * Configurable DOM selectors used by the e2e-ui test suites.\n *\n * The Verdaccio UI is a moving target — data-testids can and do change\n * between majors — so every selector referenced by a test lives here\n * and can be overridden by consumers of `@verdaccio/e2e-ui` via\n * `createRegistryConfig({ testIds, selectors })`.\n *\n * The defaults below match Verdaccio 6.x as of the last time we audited\n * the ui-components source. If a selector moves, override just the\n * affected field instead of forking the suite.\n */\n\n/**\n * Map of data-testid values used by the test suites, grouped by UI\n * section. Each field holds the bare testid string (no `data-testid=\"…\"`\n * wrapping) — the test helpers pass it through `cy.getByTestId(...)`.\n */\nexport interface TestIds {\n home: {\n /** Help card shown on the empty-registry landing page. */\n helpCard: string;\n /** 404 \"not found\" container. */\n notFound: string;\n };\n header: {\n /** Outermost `<NavBar>` element. */\n container: string;\n /** Inner wrapper inside the nav bar. */\n innerNavBar: string;\n /** Right-side action cluster wrapper. */\n right: string;\n /** Wrapper around the header search input. */\n searchContainer: string;\n /** Default SVG Verdaccio logo. */\n defaultLogo: string;\n /** Custom (user-provided) logo image. */\n customLogo: string;\n /** \"Login\" button shown when logged out. */\n loginButton: string;\n /** Gear icon that opens the settings dialog. */\n settingsTooltip: string;\n /** Info icon that opens the registry info dialog. */\n infoTooltip: string;\n /** Menu icon shown after login (opens the logged-in menu). */\n logInDialogIcon: string;\n /** \"Log out\" entry inside the logged-in menu. */\n logOutDialogIcon: string;\n /** \"Hi <username>\" label inside the logged-in menu. */\n greetingsLabel: string;\n };\n footer: {\n /** Outer footer wrapper. */\n container: string;\n /** \"Powered by\" version text on the right side of the footer. */\n version: string;\n };\n package: {\n /** Wrapper around the list of packages on the home page. */\n itemList: string;\n /** Package name link in the package list (home + search results). */\n title: string;\n /** Readme container on the package detail page. */\n readme: string;\n /** Sidebar container on the package detail page. */\n sidebar: string;\n /** Install commands section list. */\n installList: string;\n /** Individual install line for npm. */\n installNpm: string;\n /** Individual install line for yarn. */\n installYarn: string;\n /** Individual install line for pnpm. */\n installPnpm: string;\n /** Keyword list below the install section. */\n keywordList: string;\n /** Tab that reveals the dependencies view. */\n dependenciesTab: string;\n /** Dependencies list wrapper (one entry per dep). */\n dependencies: string;\n /** Tab that reveals the versions view. */\n versionsTab: string;\n /** \"latest\" tag row inside the versions view. */\n tagLatest: string;\n /** Tab that reveals the uplinks view. */\n uplinksTab: string;\n /** Empty-state message when the package has no uplinks. */\n noUplinks: string;\n };\n}\n\n/**\n * CSS selectors (not data-testids) used by the test suites. These are\n * things like form-field IDs and framework-specific class names that\n * Verdaccio's UI exposes as plain selectors rather than testids.\n */\nexport interface Selectors {\n /** Class applied to the parsed README markdown body. */\n markdownBody: string;\n loginDialog: {\n /** Username text input inside the login dialog. */\n usernameInput: string;\n /** Password text input inside the login dialog. */\n passwordInput: string;\n /** Submit button inside the login dialog. */\n submitButton: string;\n };\n}\n\n/**\n * Defaults matching Verdaccio 6.x (bundled ui-theme@9.0.0-next-9.x).\n * Overridable via `createRegistryConfig({ testIds: { ... } })`.\n */\nexport const DEFAULT_TEST_IDS: TestIds = {\n home: {\n helpCard: 'help-card',\n notFound: '404',\n },\n header: {\n container: 'header',\n innerNavBar: 'inner-nav-bar',\n right: 'header-right',\n searchContainer: 'search-container',\n defaultLogo: 'default-logo',\n customLogo: 'custom-logo',\n loginButton: 'header--button-login',\n settingsTooltip: 'header--tooltip-settings',\n infoTooltip: 'header--tooltip-info',\n logInDialogIcon: 'logInDialogIcon',\n logOutDialogIcon: 'logOutDialogIcon',\n greetingsLabel: 'greetings-label',\n },\n footer: {\n container: 'footer',\n version: 'version-footer',\n },\n package: {\n itemList: 'package-item-list',\n title: 'package-title',\n readme: 'readme',\n sidebar: 'sidebar',\n installList: 'installList',\n installNpm: 'installListItem-npm',\n installYarn: 'installListItem-yarn',\n installPnpm: 'installListItem-pnpm',\n keywordList: 'keyword-list',\n dependenciesTab: 'dependencies-tab',\n dependencies: 'dependencies',\n versionsTab: 'versions-tab',\n tagLatest: 'tag-latest',\n uplinksTab: 'uplinks-tab',\n noUplinks: 'no-uplinks',\n },\n};\n\n/**\n * Defaults for non-testid CSS selectors. Overridable via\n * `createRegistryConfig({ selectors: { ... } })`.\n */\nexport const DEFAULT_SELECTORS: Selectors = {\n markdownBody: '.markdown-body',\n loginDialog: {\n usernameInput: '#login--dialog-username',\n passwordInput: '#login--dialog-password',\n submitButton: '#login--dialog-button-submit',\n },\n};\n\n/** Deep-partial helper — every field of a nested object becomes optional. */\nexport type DeepPartial<T> = {\n [K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];\n};\n\n/**\n * Merge user overrides into the default testIds map. Merging is\n * per-section (one level deep): `overrides.header` replaces individual\n * fields under `defaults.header` without touching `defaults.footer`.\n * The shape is fixed and small, so we enumerate sections by hand\n * rather than relying on a recursive generic merger.\n */\nexport function mergeTestIds(\n defaults: TestIds,\n overrides?: DeepPartial<TestIds>\n): TestIds {\n if (!overrides) return defaults;\n return {\n home: { ...defaults.home, ...overrides.home },\n header: { ...defaults.header, ...overrides.header },\n footer: { ...defaults.footer, ...overrides.footer },\n package: { ...defaults.package, ...overrides.package },\n };\n}\n\n/** Same idea as `mergeTestIds`, for the CSS-selector block. */\nexport function mergeSelectors(\n defaults: Selectors,\n overrides?: DeepPartial<Selectors>\n): Selectors {\n if (!overrides) return defaults;\n return {\n markdownBody: overrides.markdownBody ?? defaults.markdownBody,\n loginDialog: { ...defaults.loginDialog, ...overrides.loginDialog },\n };\n}\n"],"mappings":";;;;;AAiHA,IAAa,mBAA4B;CACvC,MAAM;EACJ,UAAU;EACV,UAAU;EACX;CACD,QAAQ;EACN,WAAW;EACX,aAAa;EACb,OAAO;EACP,iBAAiB;EACjB,aAAa;EACb,YAAY;EACZ,aAAa;EACb,iBAAiB;EACjB,aAAa;EACb,iBAAiB;EACjB,kBAAkB;EAClB,gBAAgB;EACjB;CACD,QAAQ;EACN,WAAW;EACX,SAAS;EACV;CACD,SAAS;EACP,UAAU;EACV,OAAO;EACP,QAAQ;EACR,SAAS;EACT,aAAa;EACb,YAAY;EACZ,aAAa;EACb,aAAa;EACb,aAAa;EACb,iBAAiB;EACjB,cAAc;EACd,aAAa;EACb,WAAW;EACX,YAAY;EACZ,WAAW;EACZ;CACF;;;;;AAMD,IAAa,oBAA+B;CAC1C,cAAc;CACd,aAAa;EACX,eAAe;EACf,eAAe;EACf,cAAc;EACf;CACF;;;;;;;;AAcD,SAAgB,aACd,UACA,WACS;AACT,KAAI,CAAC,UAAW,QAAO;AACvB,QAAO;EACL,MAAM;GAAE,GAAG,SAAS;GAAM,GAAG,UAAU;GAAM;EAC7C,QAAQ;GAAE,GAAG,SAAS;GAAQ,GAAG,UAAU;GAAQ;EACnD,QAAQ;GAAE,GAAG,SAAS;GAAQ,GAAG,UAAU;GAAQ;EACnD,SAAS;GAAE,GAAG,SAAS;GAAS,GAAG,UAAU;GAAS;EACvD;;;AAIH,SAAgB,eACd,UACA,WACW;AACX,KAAI,CAAC,UAAW,QAAO;AACvB,QAAO;EACL,cAAc,UAAU,gBAAgB,SAAS;EACjD,aAAa;GAAE,GAAG,SAAS;GAAa,GAAG,UAAU;GAAa;EACnE"}
1
+ {"version":3,"file":"testIds.cjs","names":[],"sources":["../../src/testIds.ts"],"sourcesContent":["/**\n * Configurable DOM selectors used by the e2e-ui test suites.\n *\n * The Verdaccio UI is a moving target — data-testids can and do change\n * between majors — so every selector referenced by a test lives here\n * and can be overridden by consumers of `@verdaccio/e2e-ui` via\n * `createRegistryConfig({ testIds, selectors })`.\n *\n * The defaults below match Verdaccio 6.x as of the last time we audited\n * the ui-components source. If a selector moves, override just the\n * affected field instead of forking the suite.\n */\n\n/**\n * Map of data-testid values used by the test suites, grouped by UI\n * section. Each field holds the bare testid string (no `data-testid=\"…\"`\n * wrapping) — the test helpers pass it through `cy.getByTestId(...)`.\n */\nexport interface TestIds {\n home: {\n /** Help card shown on the empty-registry landing page. */\n helpCard: string;\n /** 404 \"not found\" container. */\n notFound: string;\n };\n header: {\n /** Outermost `<NavBar>` element. */\n container: string;\n /** Inner wrapper inside the nav bar. */\n innerNavBar: string;\n /** Right-side action cluster wrapper. */\n right: string;\n /** Wrapper around the header search input. */\n searchContainer: string;\n /** Default SVG Verdaccio logo. */\n defaultLogo: string;\n /** Custom (user-provided) logo image. */\n customLogo: string;\n /** \"Login\" button shown when logged out. */\n loginButton: string;\n /** Gear icon that opens the settings dialog. */\n settingsTooltip: string;\n /** Info icon that opens the registry info dialog. */\n infoTooltip: string;\n /**\n * Theme switch button shown while in LIGHT mode (clicking it\n * flips to dark). The underlying component swaps between this\n * and `themeSwitchDark` based on `isDarkMode`.\n */\n themeSwitchLight: string;\n /** Theme switch button shown while in DARK mode. */\n themeSwitchDark: string;\n /** Menu icon shown after login (opens the logged-in menu). */\n logInDialogIcon: string;\n /** \"Log out\" entry inside the logged-in menu. */\n logOutDialogIcon: string;\n /** \"Hi <username>\" label inside the logged-in menu. */\n greetingsLabel: string;\n };\n footer: {\n /** Outer footer wrapper. */\n container: string;\n /** \"Powered by\" version text on the right side of the footer. */\n version: string;\n };\n login: {\n /** Login dialog container (the MUI Dialog root). */\n dialog: string;\n /** DialogContent wrapper inside the login dialog. */\n dialogContent: string;\n /**\n * Error banner shown inside the login dialog when the server\n * rejects credentials (or any other `errors.root` message the form\n * sets). Renders inside the `LoginDialogFormError` component.\n */\n error: string;\n };\n package: {\n /** Wrapper around the list of packages on the home page. */\n itemList: string;\n /** Package name link in the package list (home + search results). */\n title: string;\n /** Readme container on the package detail page. */\n readme: string;\n /** Sidebar container on the package detail page. */\n sidebar: string;\n /** Install commands section list. */\n installList: string;\n /** Individual install line for npm. */\n installNpm: string;\n /** Individual install line for yarn. */\n installYarn: string;\n /** Individual install line for pnpm. */\n installPnpm: string;\n /** Keyword list below the install section. */\n keywordList: string;\n /** Tab that reveals the dependencies view. */\n dependenciesTab: string;\n /** Dependencies list wrapper (one entry per dep). */\n dependencies: string;\n /** Tab that reveals the versions view. */\n versionsTab: string;\n /** \"latest\" tag row inside the versions view. */\n tagLatest: string;\n /** Tab that reveals the uplinks view. */\n uplinksTab: string;\n /** Empty-state message when the package has no uplinks. */\n noUplinks: string;\n /** Action-bar tarball download FAB. */\n downloadTarballBtn: string;\n /** Action-bar \"view raw manifest\" FAB. */\n rawBtn: string;\n /** Full-screen dialog that opens when `rawBtn` is clicked. */\n rawViewerDialog: string;\n /** Close button inside the raw viewer dialog. */\n closeRawViewer: string;\n };\n}\n\n/**\n * CSS selectors (not data-testids) used by the test suites. These are\n * things like form-field IDs and framework-specific class names that\n * Verdaccio's UI exposes as plain selectors rather than testids.\n */\nexport interface Selectors {\n /** Class applied to the parsed README markdown body. */\n markdownBody: string;\n loginDialog: {\n /** Username text input inside the login dialog. */\n usernameInput: string;\n /** Password text input inside the login dialog. */\n passwordInput: string;\n /** Submit button inside the login dialog. */\n submitButton: string;\n };\n}\n\n/**\n * Defaults matching Verdaccio 6.x (bundled ui-theme@9.0.0-next-9.x).\n * Overridable via `createRegistryConfig({ testIds: { ... } })`.\n */\nexport const DEFAULT_TEST_IDS: TestIds = {\n home: {\n helpCard: 'help-card',\n notFound: '404',\n },\n header: {\n container: 'header',\n innerNavBar: 'inner-nav-bar',\n right: 'header-right',\n searchContainer: 'search-container',\n defaultLogo: 'default-logo',\n customLogo: 'custom-logo',\n loginButton: 'header--button-login',\n settingsTooltip: 'header--tooltip-settings',\n infoTooltip: 'header--tooltip-info',\n themeSwitchLight: 'header--button--light',\n themeSwitchDark: 'header--button--dark',\n logInDialogIcon: 'logInDialogIcon',\n logOutDialogIcon: 'logOutDialogIcon',\n greetingsLabel: 'greetings-label',\n },\n footer: {\n container: 'footer',\n version: 'version-footer',\n },\n login: {\n dialog: 'login--dialog',\n dialogContent: 'dialogContentLogin',\n error: 'error',\n },\n package: {\n itemList: 'package-item-list',\n title: 'package-title',\n readme: 'readme',\n sidebar: 'sidebar',\n installList: 'installList',\n installNpm: 'installListItem-npm',\n installYarn: 'installListItem-yarn',\n installPnpm: 'installListItem-pnpm',\n keywordList: 'keyword-list',\n dependenciesTab: 'dependencies-tab',\n dependencies: 'dependencies',\n versionsTab: 'versions-tab',\n tagLatest: 'tag-latest',\n uplinksTab: 'uplinks-tab',\n noUplinks: 'no-uplinks',\n downloadTarballBtn: 'download-tarball-btn',\n rawBtn: 'raw-btn',\n rawViewerDialog: 'rawViewer--dialog',\n closeRawViewer: 'close-raw-viewer',\n },\n};\n\n/**\n * Defaults for non-testid CSS selectors. Overridable via\n * `createRegistryConfig({ selectors: { ... } })`.\n */\nexport const DEFAULT_SELECTORS: Selectors = {\n markdownBody: '.markdown-body',\n loginDialog: {\n usernameInput: '#login--dialog-username',\n passwordInput: '#login--dialog-password',\n submitButton: '#login--dialog-button-submit',\n },\n};\n\n/** Deep-partial helper — every field of a nested object becomes optional. */\nexport type DeepPartial<T> = {\n [K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];\n};\n\n/**\n * Merge user overrides into the default testIds map. Merging is\n * per-section (one level deep): `overrides.header` replaces individual\n * fields under `defaults.header` without touching `defaults.footer`.\n * The shape is fixed and small, so we enumerate sections by hand\n * rather than relying on a recursive generic merger.\n */\nexport function mergeTestIds(\n defaults: TestIds,\n overrides?: DeepPartial<TestIds>\n): TestIds {\n if (!overrides) return defaults;\n return {\n home: { ...defaults.home, ...overrides.home },\n header: { ...defaults.header, ...overrides.header },\n footer: { ...defaults.footer, ...overrides.footer },\n login: { ...defaults.login, ...overrides.login },\n package: { ...defaults.package, ...overrides.package },\n };\n}\n\n/** Same idea as `mergeTestIds`, for the CSS-selector block. */\nexport function mergeSelectors(\n defaults: Selectors,\n overrides?: DeepPartial<Selectors>\n): Selectors {\n if (!overrides) return defaults;\n return {\n markdownBody: overrides.markdownBody ?? defaults.markdownBody,\n loginDialog: { ...defaults.loginDialog, ...overrides.loginDialog },\n };\n}\n"],"mappings":";;;;;AA6IA,IAAa,mBAA4B;CACvC,MAAM;EACJ,UAAU;EACV,UAAU;EACX;CACD,QAAQ;EACN,WAAW;EACX,aAAa;EACb,OAAO;EACP,iBAAiB;EACjB,aAAa;EACb,YAAY;EACZ,aAAa;EACb,iBAAiB;EACjB,aAAa;EACb,kBAAkB;EAClB,iBAAiB;EACjB,iBAAiB;EACjB,kBAAkB;EAClB,gBAAgB;EACjB;CACD,QAAQ;EACN,WAAW;EACX,SAAS;EACV;CACD,OAAO;EACL,QAAQ;EACR,eAAe;EACf,OAAO;EACR;CACD,SAAS;EACP,UAAU;EACV,OAAO;EACP,QAAQ;EACR,SAAS;EACT,aAAa;EACb,YAAY;EACZ,aAAa;EACb,aAAa;EACb,aAAa;EACb,iBAAiB;EACjB,cAAc;EACd,aAAa;EACb,WAAW;EACX,YAAY;EACZ,WAAW;EACX,oBAAoB;EACpB,QAAQ;EACR,iBAAiB;EACjB,gBAAgB;EACjB;CACF;;;;;AAMD,IAAa,oBAA+B;CAC1C,cAAc;CACd,aAAa;EACX,eAAe;EACf,eAAe;EACf,cAAc;EACf;CACF;;;;;;;;AAcD,SAAgB,aACd,UACA,WACS;AACT,KAAI,CAAC,UAAW,QAAO;AACvB,QAAO;EACL,MAAM;GAAE,GAAG,SAAS;GAAM,GAAG,UAAU;GAAM;EAC7C,QAAQ;GAAE,GAAG,SAAS;GAAQ,GAAG,UAAU;GAAQ;EACnD,QAAQ;GAAE,GAAG,SAAS;GAAQ,GAAG,UAAU;GAAQ;EACnD,OAAO;GAAE,GAAG,SAAS;GAAO,GAAG,UAAU;GAAO;EAChD,SAAS;GAAE,GAAG,SAAS;GAAS,GAAG,UAAU;GAAS;EACvD;;;AAIH,SAAgB,eACd,UACA,WACW;AACX,KAAI,CAAC,UAAW,QAAO;AACvB,QAAO;EACL,cAAc,UAAU,gBAAgB,SAAS;EACjD,aAAa;GAAE,GAAG,SAAS;GAAa,GAAG,UAAU;GAAa;EACnE"}
@@ -1,6 +1,8 @@
1
1
  //#region src/tests/home.ts
2
2
  function homeTests(config) {
3
3
  const { home, header, package: pkg } = config.testIds;
4
+ const { features } = config;
5
+ const registerPublishedPackageBlock = features.home.publishedPackageRendering;
4
6
  describe("home", () => {
5
7
  beforeEach(() => {
6
8
  cy.intercept("GET", "/-/verdaccio/data/packages").as("pkgs");
@@ -49,7 +51,7 @@ function homeTests(config) {
49
51
  cy.getByTestId(home.notFound, { timeout: 1e4 }).should("be.visible");
50
52
  cy.getByTestId(home.notFound).contains("Sorry, we couldn't find it.");
51
53
  });
52
- describe("with a published package", () => {
54
+ (registerPublishedPackageBlock ? describe : describe.skip)("with a published package", () => {
53
55
  const pkgName = "@verdaccio/home-fixture";
54
56
  let tempFolder = null;
55
57
  beforeEach(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"home.cjs","names":[],"sources":["../../../src/tests/home.ts"],"sourcesContent":["/// <reference types=\"cypress\" />\n\nimport { RegistryConfig } from '../types';\n\nexport function homeTests(config: RegistryConfig) {\n const { home, header, package: pkg } = config.testIds;\n\n describe('home', () => {\n beforeEach(() => {\n cy.intercept('GET', '/-/verdaccio/data/packages').as('pkgs');\n cy.visit(config.registryUrl);\n // Wait for the app to render\n cy.get('body').should('be.visible');\n });\n\n afterEach(() => {\n cy.wait(2000);\n });\n\n it('title should be correct', () => {\n cy.location('pathname').should('include', '/');\n cy.title().should('eq', config.title);\n });\n\n it('should fetch the package list from the API', () => {\n // The home page always fires /-/verdaccio/data/packages on mount;\n // verifying the endpoint is healthy is the cheapest way to catch\n // registry-side regressions before any DOM assertions.\n //\n // Accept both 200 (fresh fetch) and 304 (cache hit from a prior\n // spec run in the same session) — both indicate a healthy endpoint.\n // 304 responses have no body, so only assert array-shape on 200.\n cy.wait('@pkgs', { timeout: 10000 }).then((interception) => {\n const status = interception.response?.statusCode;\n expect(status).to.be.oneOf([200, 304]);\n if (status === 200) {\n expect(interception.response?.body).to.be.an('array');\n }\n });\n });\n\n it('should match title with no packages published', () => {\n cy.wait('@pkgs');\n cy.getByTestId(home.helpCard, { timeout: 10000 }).should('be.visible');\n cy.getByTestId(home.helpCard).contains('No Package Published Yet.');\n });\n\n it('should display instructions on help card', () => {\n cy.wait('@pkgs');\n cy.getByTestId(home.helpCard, { timeout: 10000 }).should('be.visible');\n cy.getByTestId(home.helpCard).contains(\n `npm adduser --registry ${config.registryUrl}`\n );\n cy.getByTestId(home.helpCard).contains(\n `npm publish --registry ${config.registryUrl}`\n );\n });\n\n it('should render the header logo and login button', () => {\n cy.getByTestId(header.container).should('be.visible');\n cy.get(\n `[data-testid=\"${header.defaultLogo}\"], [data-testid=\"${header.customLogo}\"]`\n ).should('be.visible');\n cy.getByTestId(header.loginButton).should('be.visible');\n });\n\n it('should navigate back to home when clicking the header logo', () => {\n // Land on the 404 page, then click the logo — URL should reset.\n cy.visit(`${config.registryUrl}/-/web/detail/@verdaccio/not-found`);\n cy.getByTestId(home.notFound, { timeout: 10000 }).should('be.visible');\n cy.get(\n `[data-testid=\"${header.defaultLogo}\"], [data-testid=\"${header.customLogo}\"]`\n )\n .first()\n .click();\n cy.location('pathname').should('eq', '/');\n cy.getByTestId(home.helpCard).should('be.visible');\n });\n\n it('should go to 404 page', () => {\n cy.visit(`${config.registryUrl}/-/web/detail/@verdaccio/not-found`);\n cy.getByTestId(home.notFound, { timeout: 10000 }).should('be.visible');\n cy.getByTestId(home.notFound).contains(\"Sorry, we couldn't find it.\");\n });\n\n // ── Rendering assertions that require real package data ─────────\n // Publishes a throwaway package before each test in this block so\n // we can verify the home page actually renders the list (not just\n // the empty state) and cleans up after each test so the outer\n // \"empty registry\" assertions above keep working in isolation.\n describe('with a published package', () => {\n const pkgName = '@verdaccio/home-fixture';\n let tempFolder: string | null = null;\n\n beforeEach(() => {\n cy.task('publishPackage', {\n pkgName,\n version: '1.0.0',\n unique: true,\n }).then((result) => {\n tempFolder = result?.tempFolder ?? null;\n });\n // Re-visit so the page picks up the just-published package.\n cy.visit(config.registryUrl);\n });\n\n afterEach(() => {\n cy.task('unpublishPackage', {\n pkgName,\n tempFolder: tempFolder ?? undefined,\n });\n if (tempFolder) {\n cy.task('cleanupPublished', tempFolder);\n }\n tempFolder = null;\n });\n\n it('should render the package list when a package exists', () => {\n cy.wait('@pkgs');\n cy.getByTestId(pkg.itemList).should('be.visible');\n cy.getByTestId(pkg.title).should('have.length.at.least', 1);\n });\n\n it('should show the published package name in the list', () => {\n cy.wait('@pkgs');\n cy.contains(`[data-testid=\"${pkg.title}\"]`, pkgName).should(\n 'be.visible'\n );\n });\n });\n });\n}\n"],"mappings":";AAIA,SAAgB,UAAU,QAAwB;CAChD,MAAM,EAAE,MAAM,QAAQ,SAAS,QAAQ,OAAO;AAE9C,UAAS,cAAc;AACrB,mBAAiB;AACf,MAAG,UAAU,OAAO,6BAA6B,CAAC,GAAG,OAAO;AAC5D,MAAG,MAAM,OAAO,YAAY;AAE5B,MAAG,IAAI,OAAO,CAAC,OAAO,aAAa;IACnC;AAEF,kBAAgB;AACd,MAAG,KAAK,IAAK;IACb;AAEF,KAAG,iCAAiC;AAClC,MAAG,SAAS,WAAW,CAAC,OAAO,WAAW,IAAI;AAC9C,MAAG,OAAO,C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AAK,SAAS,CAAC,OAAO,aAAa;IAClD;AAEF,KAAG,+BAA+B;AAChC,MAAG,MAAM,GAAG,OAAO,YAAY,oCAAoC;AACnE,MAAG,YAAY,KAAK,UAAU,EAAE,SAAS,KAAO,CAAC,CAAC,OAAO,aAAa;AACtE,MAAG,YAAY,KAAK,SAAS,CAAC,SAAS,8BAA8B;IACrE;AAOF,WAAS,kCAAkC;GACzC,MAAM,UAAU;GAChB,IAAI,aAA4B;AAEhC,oBAAiB;AACf,OAAG,KAAK,kBAAkB;KACxB;KACA,SAAS;KACT,QAAQ;KACT,CAAC,CAAC,MAAM,WAAW;AAClB,kBAAa,QAAQ,cAAc;MACnC;AAEF,OAAG,MAAM,OAAO,YAAY;KAC5B;AAEF,mBAAgB;AACd,OAAG,KAAK,oBAAoB;KAC1B;KACA,YAAY,cAAc,KAAA;KAC3B,CAAC;AACF,QAAI,WACF,IAAG,KAAK,oBAAoB,WAAW;AAEzC,iBAAa;KACb;AAEF,MAAG,8DAA8D;AAC/D,OAAG,KAAK,QAAQ;AAChB,OAAG,YAAY,IAAI,SAAS,CAAC,OAAO,aAAa;AACjD,OAAG,YAAY,IAAI,MAAM,CAAC,OAAO,wBAAwB,EAAE;KAC3D;AAEF,MAAG,4DAA4D;AAC7D,OAAG,KAAK,QAAQ;AAChB,OAAG,SAAS,iBAAiB,IAAI,MAAM,KAAK,QAAQ,CAAC,OACnD,aACD;KACD;IACF;GACF"}
1
+ {"version":3,"file":"home.cjs","names":[],"sources":["../../../src/tests/home.ts"],"sourcesContent":["/// <reference types=\"cypress\" />\n\nimport { RegistryConfig } from '../types';\n\nexport function homeTests(config: RegistryConfig) {\n const { home, header, package: pkg } = config.testIds;\n const { features } = config;\n\n // Only register the `with a published package` nested describe when\n // the corresponding feature flag is on. Using a plain `if` is simpler\n // than wrapping `describe` itself in `describe.skip`, and it avoids\n // emitting a pending describe block in reports.\n const registerPublishedPackageBlock = features.home.publishedPackageRendering;\n\n describe('home', () => {\n beforeEach(() => {\n cy.intercept('GET', '/-/verdaccio/data/packages').as('pkgs');\n cy.visit(config.registryUrl);\n // Wait for the app to render\n cy.get('body').should('be.visible');\n });\n\n afterEach(() => {\n cy.wait(2000);\n });\n\n it('title should be correct', () => {\n cy.location('pathname').should('include', '/');\n cy.title().should('eq', config.title);\n });\n\n it('should fetch the package list from the API', () => {\n // The home page always fires /-/verdaccio/data/packages on mount;\n // verifying the endpoint is healthy is the cheapest way to catch\n // registry-side regressions before any DOM assertions.\n //\n // Accept both 200 (fresh fetch) and 304 (cache hit from a prior\n // spec run in the same session) — both indicate a healthy endpoint.\n // 304 responses have no body, so only assert array-shape on 200.\n cy.wait('@pkgs', { timeout: 10000 }).then((interception) => {\n const status = interception.response?.statusCode;\n expect(status).to.be.oneOf([200, 304]);\n if (status === 200) {\n expect(interception.response?.body).to.be.an('array');\n }\n });\n });\n\n it('should match title with no packages published', () => {\n cy.wait('@pkgs');\n cy.getByTestId(home.helpCard, { timeout: 10000 }).should('be.visible');\n cy.getByTestId(home.helpCard).contains('No Package Published Yet.');\n });\n\n it('should display instructions on help card', () => {\n cy.wait('@pkgs');\n cy.getByTestId(home.helpCard, { timeout: 10000 }).should('be.visible');\n cy.getByTestId(home.helpCard).contains(\n `npm adduser --registry ${config.registryUrl}`\n );\n cy.getByTestId(home.helpCard).contains(\n `npm publish --registry ${config.registryUrl}`\n );\n });\n\n it('should render the header logo and login button', () => {\n cy.getByTestId(header.container).should('be.visible');\n cy.get(\n `[data-testid=\"${header.defaultLogo}\"], [data-testid=\"${header.customLogo}\"]`\n ).should('be.visible');\n cy.getByTestId(header.loginButton).should('be.visible');\n });\n\n it('should navigate back to home when clicking the header logo', () => {\n // Land on the 404 page, then click the logo — URL should reset.\n cy.visit(`${config.registryUrl}/-/web/detail/@verdaccio/not-found`);\n cy.getByTestId(home.notFound, { timeout: 10000 }).should('be.visible');\n cy.get(\n `[data-testid=\"${header.defaultLogo}\"], [data-testid=\"${header.customLogo}\"]`\n )\n .first()\n .click();\n cy.location('pathname').should('eq', '/');\n cy.getByTestId(home.helpCard).should('be.visible');\n });\n\n it('should go to 404 page', () => {\n cy.visit(`${config.registryUrl}/-/web/detail/@verdaccio/not-found`);\n cy.getByTestId(home.notFound, { timeout: 10000 }).should('be.visible');\n cy.getByTestId(home.notFound).contains(\"Sorry, we couldn't find it.\");\n });\n\n // ── Rendering assertions that require real package data ─────────\n // Publishes a throwaway package before each test in this block so\n // we can verify the home page actually renders the list (not just\n // the empty state) and cleans up after each test so the outer\n // \"empty registry\" assertions above keep working in isolation.\n //\n // Gated on `features.home.publishedPackageRendering` so builds\n // where this shape doesn't apply can skip it without forking.\n (registerPublishedPackageBlock ? describe : describe.skip)('with a published package', () => {\n const pkgName = '@verdaccio/home-fixture';\n let tempFolder: string | null = null;\n\n beforeEach(() => {\n cy.task('publishPackage', {\n pkgName,\n version: '1.0.0',\n unique: true,\n }).then((result) => {\n tempFolder = result?.tempFolder ?? null;\n });\n // Re-visit so the page picks up the just-published package.\n cy.visit(config.registryUrl);\n });\n\n afterEach(() => {\n cy.task('unpublishPackage', {\n pkgName,\n tempFolder: tempFolder ?? undefined,\n });\n if (tempFolder) {\n cy.task('cleanupPublished', tempFolder);\n }\n tempFolder = null;\n });\n\n it('should render the package list when a package exists', () => {\n cy.wait('@pkgs');\n cy.getByTestId(pkg.itemList).should('be.visible');\n cy.getByTestId(pkg.title).should('have.length.at.least', 1);\n });\n\n it('should show the published package name in the list', () => {\n cy.wait('@pkgs');\n cy.contains(`[data-testid=\"${pkg.title}\"]`, pkgName).should(\n 'be.visible'\n );\n });\n });\n });\n}\n"],"mappings":";AAIA,SAAgB,UAAU,QAAwB;CAChD,MAAM,EAAE,MAAM,QAAQ,SAAS,QAAQ,OAAO;CAC9C,MAAM,EAAE,aAAa;CAMrB,MAAM,gCAAgC,SAAS,KAAK;AAEpD,UAAS,cAAc;AACrB,mBAAiB;AACf,MAAG,UAAU,OAAO,6BAA6B,CAAC,GAAG,OAAO;AAC5D,MAAG,MAA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EAAE,SAAS,KAAO,CAAC,CAAC,OAAO,aAAa;AACtE,MAAG,IACD,iBAAiB,OAAO,YAAY,oBAAoB,OAAO,WAAW,IAC3E,CACE,OAAO,CACP,OAAO;AACV,MAAG,SAAS,WAAW,CAAC,OAAO,MAAM,IAAI;AACzC,MAAG,YAAY,KAAK,SAAS,CAAC,OAAO,aAAa;IAClD;AAEF,KAAG,+BAA+B;AAChC,MAAG,MAAM,GAAG,OAAO,YAAY,oCAAoC;AACnE,MAAG,YAAY,KAAK,UAAU,EAAE,SAAS,KAAO,CAAC,CAAC,OAAO,aAAa;AACtE,MAAG,YAAY,KAAK,SAAS,CAAC,SAAS,8BAA8B;IACrE;AAUF,GAAC,gCAAgC,WAAW,SAAS,MAAM,kCAAkC;GAC3F,MAAM,UAAU;GAChB,IAAI,aAA4B;AAEhC,oBAAiB;AACf,OAAG,KAAK,kBAAkB;KACxB;KACA,SAAS;KACT,QAAQ;KACT,CAAC,CAAC,MAAM,WAAW;AAClB,kBAAa,QAAQ,cAAc;MACnC;AAEF,OAAG,MAAM,OAAO,YAAY;KAC5B;AAEF,mBAAgB;AACd,OAAG,KAAK,oBAAoB;KAC1B;KACA,YAAY,cAAc,KAAA;KAC3B,CAAC;AACF,QAAI,WACF,IAAG,KAAK,oBAAoB,WAAW;AAEzC,iBAAa;KACb;AAEF,MAAG,8DAA8D;AAC/D,OAAG,KAAK,QAAQ;AAChB,OAAG,YAAY,IAAI,SAAS,CAAC,OAAO,aAAa;AACjD,OAAG,YAAY,IAAI,MAAM,CAAC,OAAO,wBAAwB,EAAE;KAC3D;AAEF,MAAG,4DAA4D;AAC7D,OAAG,KAAK,QAAQ;AAChB,OAAG,SAAS,iBAAiB,IAAI,MAAM,KAAK,QAAQ,CAAC,OACnD,aACD;KACD;IACF;GACF"}
@@ -1,3 +1,4 @@
1
+ const require_features = require("../features.cjs");
1
2
  //#region src/tests/layout.ts
2
3
  /**
3
4
  * Tests for the persistent page chrome: the header (nav bar, logo,
@@ -11,6 +12,7 @@
11
12
  */
12
13
  function layoutTests(config) {
13
14
  const { header, footer } = config.testIds;
15
+ const { features } = config;
14
16
  describe("layout: header, footer, ui-options", () => {
15
17
  beforeEach(() => {
16
18
  cy.intercept("GET", "**/-/static/ui-options.js").as("uiOptions");
@@ -51,6 +53,14 @@ function layoutTests(config) {
51
53
  cy.getByTestId(header.settingsTooltip).should("be.visible");
52
54
  cy.getByTestId(header.infoTooltip).should("be.visible");
53
55
  });
56
+ require_features.maybeIt(features.layout.themeSwitch)("should toggle between light and dark mode", () => {
57
+ cy.getByTestId(header.themeSwitchLight).should("be.visible").click();
58
+ cy.getByTestId(header.themeSwitchDark, { timeout: 5e3 }).should("be.visible");
59
+ cy.getByTestId(header.themeSwitchLight).should("not.exist");
60
+ cy.window().its("localStorage").invoke("getItem", "darkMode").should("eq", "true");
61
+ cy.getByTestId(header.themeSwitchDark).click();
62
+ cy.getByTestId(header.themeSwitchLight, { timeout: 5e3 }).should("be.visible");
63
+ });
54
64
  });
55
65
  describe("footer", () => {
56
66
  it("should render the footer container", () => {
@@ -1 +1 @@
1
- {"version":3,"file":"layout.cjs","names":[],"sources":["../../../src/tests/layout.ts"],"sourcesContent":["/// <reference types=\"cypress\" />\n\nimport { RegistryConfig } from '../types';\n\n/**\n * Tests for the persistent page chrome: the header (nav bar, logo,\n * search container, action buttons) and the footer (version marker).\n * Also asserts that the runtime UI configuration endpoint\n * `/-/static/ui-options.js` loads successfully — this endpoint emits\n * `window.__VERDACCIO_BASENAME_UI_OPTIONS`, which the ui-theme relies\n * on for feature flags like showFooter / showSearch / showSettings. If\n * it fails the whole SPA degrades to whatever defaults the provider\n * ships with, so it's worth a direct network-level check.\n */\nexport function layoutTests(config: RegistryConfig) {\n const { header, footer } = config.testIds;\n\n describe('layout: header, footer, ui-options', () => {\n beforeEach(() => {\n cy.intercept('GET', '**/-/static/ui-options.js').as('uiOptions');\n cy.visit(config.registryUrl);\n cy.get('body').should('be.visible');\n });\n\n it('should load /-/static/ui-options.js with HTTP 200', () => {\n cy.wait('@uiOptions', { timeout: 10000 })\n .its('response.statusCode')\n .should('eq', 200);\n });\n\n it('should serve ui-options.js with a JavaScript content-type', () => {\n cy.wait('@uiOptions', { timeout: 10000 }).then((interception: any) => {\n const contentType =\n interception.response?.headers?.['content-type'] || '';\n // Verdaccio serves this as `application/javascript` (possibly\n // with a charset suffix). Match loosely so small header tweaks\n // don't break the test.\n expect(contentType).to.match(/javascript/i);\n });\n });\n\n it('should expose window.__VERDACCIO_BASENAME_UI_OPTIONS at runtime', () => {\n cy.wait('@uiOptions', { timeout: 10000 });\n // ui-options.js sets this global before the React app boots, so\n // by the time the body is visible it should already be populated.\n cy.window()\n .its('__VERDACCIO_BASENAME_UI_OPTIONS')\n .should('be.an', 'object');\n });\n\n describe('header', () => {\n it('should render the header container', () => {\n cy.getByTestId(header.container).should('be.visible');\n cy.getByTestId(header.innerNavBar).should('be.visible');\n });\n\n it('should render the logo', () => {\n // Either the default SVG logo or a user-provided custom one.\n cy.get(\n `[data-testid=\"${header.defaultLogo}\"], [data-testid=\"${header.customLogo}\"]`\n ).should('be.visible');\n });\n\n it('should render the search container', () => {\n cy.getByTestId(header.searchContainer).should('be.visible');\n });\n\n it('should render the header-right action cluster', () => {\n cy.getByTestId(header.right).should('be.visible');\n });\n\n it('should render the login button when logged out', () => {\n cy.getByTestId(header.loginButton).should('be.visible');\n });\n\n it('should render the settings and info buttons', () => {\n // Both depend on `showSettings` / `showInfo` being truthy in\n // the ui-options response. On the default config provider\n // they default to true so no explicit registry config is\n // required.\n cy.getByTestId(header.settingsTooltip).should('be.visible');\n cy.getByTestId(header.infoTooltip).should('be.visible');\n });\n });\n\n describe('footer', () => {\n it('should render the footer container', () => {\n cy.getByTestId(footer.container).scrollIntoView().should('be.visible');\n });\n\n it('should render the version marker with the powered-by label', () => {\n // <PoweredBy> only renders when `configOptions.version` is\n // truthy, which Verdaccio sets automatically from its\n // package.json at startup.\n cy.getByTestId(footer.version)\n .scrollIntoView()\n .should('be.visible')\n .invoke('text')\n .should('have.length.greaterThan', 0);\n });\n\n it('should render a logo next to the version marker', () => {\n // The footer uses the default SVG logo as the link to\n // verdaccio.org.\n cy.getByTestId(footer.container)\n .find(\n `[data-testid=\"${header.defaultLogo}\"], [data-testid=\"${header.customLogo}\"]`\n )\n .should('exist');\n });\n });\n });\n}\n"],"mappings":";;;;;;;;;;;AAcA,SAAgB,YAAY,QAAwB;CAClD,MAAM,EAAE,QAAQ,WAAW,OAAO;AAElC,UAAS,4CAA4C;AACnD,mBAAiB;AACf,MAAG,UAAU,OAAO,4BAA4B,CAAC,GAAG,YAAY;AAChE,MAAG,MAAM,OAAO,YAAY;AAC5B,MAAG,IAAI,OAAO,CAAC,OAAO,aAAa;IACnC;AAEF,KAAG,2DAA2D;AAC5D,MAAG,KAAK,cAAc,EAAE,SAAS,KAAO,CAAC,CACtC,IAAI,sBAAsB,CAC1B,OAAO,MAAM,IAAI;IACpB;AAEF,KAAG,mEAAmE;AACpE,MAAG,KAAK,cAAc,EAAE,SAAS,KAAO,CAAC,CAAC,MAAM,iBAAsB;IACpE,MAAM,cACJ,aAAa,UAAU,UAAU,mBAAmB;AAItD,WAAO,YAAY,CAAC,GAAG,MAAM,cAAc;KAC3C;IACF;AAEF,KAAG,yEAAyE;AAC1E,MAAG,KAAK,cAAc,EAAE,SAAS,KAAO,CAAC;AAGzC,MAAG,QAAQ,CACR,IAAI,kCAAkC,CACtC,OAAO,SAAS,SAAS;IAC5B;AAEF,WAAS,gBAAgB;AACvB,MAAG,4CAA4C;AAC7C,OAAG,YAAY,OAAO,UAAU,CAAC,OAAO,aAAa;AACrD,OAAG,YAAY,OAAO,YAAY,CAAC,OAAO,aAAa;KACvD;AAEF,MAAG,gCAAgC;AAEjC,OAAG,IACD,iBAAiB,OAAO,YAAY,oBAAoB,OAAO,WAAW,IAC3E,CAAC,OAAO,aAAa;KACtB;AAEF,MAAG,4CAA4C;AAC7C,OAAG,YAAY,OAAO,gBAAgB,CAAC,OAAO,aAAa;KAC3D;AAEF,MAAG,uDAAuD;AACxD,OAAG,YAAY,OAAO,MAAM,CAAC,OAAO,aAAa;KACjD;AAEF,MAAG,wDAAwD;AACzD,OAAG,YAAY,OAAO,YAAY,CAAC,OAAO,aAAa;KACvD;AAEF,MAAG,qDAAqD;AAKtD,OAAG,YAAY,OAAO,gBAAgB,CAAC,OAAO,aAAa;AAC3D,OAAG,YAAY,OAAO,YAAY,CAAC,OAAO,aAAa;KACvD;IACF;AAEF,WAAS,gBAAgB;AACvB,MAAG,4CAA4C;AAC7C,OAAG,YAAY,OAAO,UAAU,CAAC,gBAAgB,CAAC,OAAO,aAAa;KACtE;AAEF,MAAG,oEAAoE;AAIrE,OAAG,YAAY,OAAO,QAAQ,CAC3B,gBAAgB,CAChB,OAAO,aAAa,CACpB,OAAO,OAAO,CACd,OAAO,2BAA2B,EAAE;KACvC;AAEF,MAAG,yDAAyD;AAG1D,OAAG,YAAY,OAAO,UAAU,CAC7B,KACC,iBAAiB,OAAO,YAAY,oBAAoB,OAAO,WAAW,IAC3E,CACA,OAAO,QAAQ;KAClB;IACF;GACF"}
1
+ {"version":3,"file":"layout.cjs","names":[],"sources":["../../../src/tests/layout.ts"],"sourcesContent":["/// <reference types=\"cypress\" />\n\nimport { maybeIt } from '../features';\nimport { RegistryConfig } from '../types';\n\n/**\n * Tests for the persistent page chrome: the header (nav bar, logo,\n * search container, action buttons) and the footer (version marker).\n * Also asserts that the runtime UI configuration endpoint\n * `/-/static/ui-options.js` loads successfully — this endpoint emits\n * `window.__VERDACCIO_BASENAME_UI_OPTIONS`, which the ui-theme relies\n * on for feature flags like showFooter / showSearch / showSettings. If\n * it fails the whole SPA degrades to whatever defaults the provider\n * ships with, so it's worth a direct network-level check.\n */\nexport function layoutTests(config: RegistryConfig) {\n const { header, footer } = config.testIds;\n const { features } = config;\n\n describe('layout: header, footer, ui-options', () => {\n beforeEach(() => {\n cy.intercept('GET', '**/-/static/ui-options.js').as('uiOptions');\n cy.visit(config.registryUrl);\n cy.get('body').should('be.visible');\n });\n\n it('should load /-/static/ui-options.js with HTTP 200', () => {\n cy.wait('@uiOptions', { timeout: 10000 })\n .its('response.statusCode')\n .should('eq', 200);\n });\n\n it('should serve ui-options.js with a JavaScript content-type', () => {\n cy.wait('@uiOptions', { timeout: 10000 }).then((interception: any) => {\n const contentType =\n interception.response?.headers?.['content-type'] || '';\n // Verdaccio serves this as `application/javascript` (possibly\n // with a charset suffix). Match loosely so small header tweaks\n // don't break the test.\n expect(contentType).to.match(/javascript/i);\n });\n });\n\n it('should expose window.__VERDACCIO_BASENAME_UI_OPTIONS at runtime', () => {\n cy.wait('@uiOptions', { timeout: 10000 });\n // ui-options.js sets this global before the React app boots, so\n // by the time the body is visible it should already be populated.\n cy.window()\n .its('__VERDACCIO_BASENAME_UI_OPTIONS')\n .should('be.an', 'object');\n });\n\n describe('header', () => {\n it('should render the header container', () => {\n cy.getByTestId(header.container).should('be.visible');\n cy.getByTestId(header.innerNavBar).should('be.visible');\n });\n\n it('should render the logo', () => {\n // Either the default SVG logo or a user-provided custom one.\n cy.get(\n `[data-testid=\"${header.defaultLogo}\"], [data-testid=\"${header.customLogo}\"]`\n ).should('be.visible');\n });\n\n it('should render the search container', () => {\n cy.getByTestId(header.searchContainer).should('be.visible');\n });\n\n it('should render the header-right action cluster', () => {\n cy.getByTestId(header.right).should('be.visible');\n });\n\n it('should render the login button when logged out', () => {\n cy.getByTestId(header.loginButton).should('be.visible');\n });\n\n it('should render the settings and info buttons', () => {\n // Both depend on `showSettings` / `showInfo` being truthy in\n // the ui-options response. On the default config provider\n // they default to true so no explicit registry config is\n // required.\n cy.getByTestId(header.settingsTooltip).should('be.visible');\n cy.getByTestId(header.infoTooltip).should('be.visible');\n });\n\n maybeIt(features.layout.themeSwitch)(\n 'should toggle between light and dark mode',\n () => {\n // Cypress clears localStorage between tests (testIsolation),\n // so each test starts from whatever the client default is.\n // On CI the default is light (the Electron headless browser\n // reports `prefers-color-scheme: light`).\n //\n // `handleToggleDarkLightMode` in HeaderRight wraps\n // `setIsDarkMode` in a 300ms setTimeout, so we assert with\n // Cypress's built-in retryability (no `cy.wait(ms)` needed —\n // the `.should('be.visible')` retry window covers it).\n\n // Start: light mode → the \"light\" icon button is rendered.\n cy.getByTestId(header.themeSwitchLight).should('be.visible').click();\n\n // After the debounced flip, the \"dark\" variant replaces it.\n cy.getByTestId(header.themeSwitchDark, { timeout: 5000 }).should(\n 'be.visible'\n );\n cy.getByTestId(header.themeSwitchLight).should('not.exist');\n\n // localStorage.darkMode is the source of truth (see\n // useLocalStorage('darkMode', …) in ThemeProvider).\n cy.window().its('localStorage').invoke('getItem', 'darkMode')\n .should('eq', 'true');\n\n // Toggle back so subsequent tests don't inherit dark state\n // via a stale cache (testIsolation clears localStorage, but\n // being explicit keeps the assertion symmetric).\n cy.getByTestId(header.themeSwitchDark).click();\n cy.getByTestId(header.themeSwitchLight, { timeout: 5000 }).should(\n 'be.visible'\n );\n }\n );\n });\n\n describe('footer', () => {\n it('should render the footer container', () => {\n cy.getByTestId(footer.container).scrollIntoView().should('be.visible');\n });\n\n it('should render the version marker with the powered-by label', () => {\n // <PoweredBy> only renders when `configOptions.version` is\n // truthy, which Verdaccio sets automatically from its\n // package.json at startup.\n cy.getByTestId(footer.version)\n .scrollIntoView()\n .should('be.visible')\n .invoke('text')\n .should('have.length.greaterThan', 0);\n });\n\n it('should render a logo next to the version marker', () => {\n // The footer uses the default SVG logo as the link to\n // verdaccio.org.\n cy.getByTestId(footer.container)\n .find(\n `[data-testid=\"${header.defaultLogo}\"], [data-testid=\"${header.customLogo}\"]`\n )\n .should('exist');\n });\n });\n });\n}\n"],"mappings":";;;;;;;;;;;;AAeA,SAAgB,YAAY,QAAwB;CAClD,MAAM,EAAE,QAAQ,WAAW,OAAO;CAClC,MAAM,EAAE,aAAa;AAErB,UAAS,4CAA4C;AACnD,mBAAiB;AACf,MAAG,UAAU,OAAO,4BAA4B,CAAC,GAAG,YAAY;AAChE,MAAG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CAAC,OAAO;AAGpE,OAAG,YAAY,OAAO,iBAAiB,EAAE,SAAS,KAAM,CAAC,CAAC,OACxD,aACD;AACD,OAAG,YAAY,OAAO,iBAAiB,CAAC,OAAO,YAAY;AAI3D,OAAG,QAAQ,CAAC,IAAI,eAAe,CAAC,OAAO,WAAW,WAAW,CAC1D,OAAO,MAAM,OAAO;AAKvB,OAAG,YAAY,OAAO,gBAAgB,CAAC,OAAO;AAC9C,OAAG,YAAY,OAAO,kBAAkB,EAAE,SAAS,KAAM,CAAC,CAAC,OACzD,aACD;KAEJ;IACD;AAEF,WAAS,gBAAgB;AACvB,MAAG,4CAA4C;AAC7C,OAAG,YAAY,OAAO,UAAU,CAAC,gBAAgB,CAAC,OAAO,aAAa;KACtE;AAEF,MAAG,oEAAoE;AAIrE,OAAG,YAAY,OAAO,QAAQ,CAC3B,gBAAgB,CAChB,OAAO,aAAa,CACpB,OAAO,OAAO,CACd,OAAO,2BAA2B,EAAE;KACvC;AAEF,MAAG,yDAAyD;AAG1D,OAAG,YAAY,OAAO,UAAU,CAC7B,KACC,iBAAiB,OAAO,YAAY,oBAAoB,OAAO,WAAW,IAC3E,CACA,OAAO,QAAQ;KAClB;IACF;GACF"}
@@ -1,9 +1,13 @@
1
+ const require_features = require("../features.cjs");
1
2
  //#region src/tests/publish.ts
2
3
  function publishTests(config) {
3
4
  const { header, package: pkg } = config.testIds;
4
5
  const { markdownBody, loginDialog } = config.selectors;
6
+ const { features } = config;
5
7
  describe("publish", () => {
6
8
  const pkgName = "@verdaccio/pkg-scoped";
9
+ const depName = "debug";
10
+ const depVersion = "4.0.0";
7
11
  let tempFolder = null;
8
12
  /**
9
13
  * Log in once, reuse the session across every test in this suite.
@@ -36,7 +40,7 @@ function publishTests(config) {
36
40
  cy.task("publishPackage", {
37
41
  pkgName,
38
42
  version: "1.0.0",
39
- dependencies: { debug: "4.0.0" },
43
+ dependencies: { [depName]: depVersion },
40
44
  unique: true
41
45
  }).then((result) => {
42
46
  tempFolder = result?.tempFolder ?? null;
@@ -101,7 +105,8 @@ function publishTests(config) {
101
105
  cy.getByTestId(pkg.dependenciesTab).click();
102
106
  cy.wait(100);
103
107
  cy.getByTestId(pkg.dependencies).should("have.length", 1);
104
- cy.getByTestId("debug").children().invoke("text").should("match", /debug/);
108
+ cy.getByTestId(depName).should("be.visible").and("contain.text", depName).and("contain.text", depVersion);
109
+ cy.getByTestId(depName).invoke("text").should("match", new RegExp(`${depName}\\s*:\\s*${depVersion}`));
105
110
  });
106
111
  it("should click on versions tab", () => {
107
112
  cy.wait("@pkgs");
@@ -121,6 +126,24 @@ function publishTests(config) {
121
126
  cy.getByTestId(pkg.uplinksTab).click();
122
127
  cy.getByTestId(pkg.noUplinks).should("be.visible");
123
128
  });
129
+ require_features.maybeIt(features.publish.downloadTarball)("should fetch the tarball when the download button is clicked", () => {
130
+ cy.intercept("GET", "**/pkg-scoped-*.tgz").as("tarballFetch");
131
+ cy.wait("@pkgs");
132
+ cy.getByTestId(pkg.title).first().click();
133
+ cy.wait("@sidebar");
134
+ cy.getByTestId(pkg.downloadTarballBtn).should("be.visible").click();
135
+ cy.wait("@tarballFetch", { timeout: 1e4 }).its("response.statusCode").should("eq", 200);
136
+ });
137
+ require_features.maybeIt(features.publish.rawViewer)("should open the raw manifest viewer when the raw button is clicked", () => {
138
+ cy.wait("@pkgs");
139
+ cy.getByTestId(pkg.title).first().click();
140
+ cy.wait("@sidebar");
141
+ cy.getByTestId(pkg.rawBtn).should("be.visible").click();
142
+ cy.getByTestId(pkg.rawViewerDialog, { timeout: 5e3 }).should("be.visible");
143
+ cy.getByTestId(pkg.rawViewerDialog).should("contain.text", pkgName);
144
+ cy.getByTestId(pkg.closeRawViewer).click();
145
+ cy.getByTestId(pkg.rawViewerDialog).should("not.exist");
146
+ });
124
147
  });
125
148
  }
126
149
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"publish.cjs","names":[],"sources":["../../../src/tests/publish.ts"],"sourcesContent":["/// <reference types=\"cypress\" />\n\nimport { RegistryConfig } from '../types';\n\nexport function publishTests(config: RegistryConfig) {\n const { header, package: pkg } = config.testIds;\n const { markdownBody, loginDialog } = config.selectors;\n\n describe('publish', () => {\n const pkgName = '@verdaccio/pkg-scoped';\n // Per-test state so afterEach can clean up the specific publish\n // that this test created (temp folder + registry entry).\n let tempFolder: string | null = null;\n\n /**\n * Log in once, reuse the session across every test in this suite.\n * `cy.session` caches cookies + localStorage keyed on the first\n * argument, so subsequent calls restore without hitting the network.\n */\n const loginOnce = () => {\n cy.session(\n ['publish-suite', config.credentials.user],\n () => {\n cy.visit(config.registryUrl);\n cy.login(config.credentials.user, config.credentials.password, {\n loginButton: header.loginButton,\n ...loginDialog,\n });\n cy.wait('@sign');\n },\n {\n validate() {\n cy.request({\n url: `${config.registryUrl}/-/verdaccio/data/packages`,\n failOnStatusCode: false,\n })\n .its('status')\n .should('be.oneOf', [200, 304]);\n },\n cacheAcrossSpecs: true,\n }\n );\n };\n\n beforeEach(() => {\n cy.intercept('POST', '/-/verdaccio/sec/login').as('sign');\n cy.intercept('GET', '/-/verdaccio/data/packages').as('pkgs');\n cy.intercept('GET', `/-/verdaccio/data/sidebar/${pkgName}`).as('sidebar');\n cy.intercept('GET', `/-/verdaccio/data/package/readme/${pkgName}`).as('readme');\n\n // Publish a fresh copy for this test. `unique: true` appends a\n // timestamp suffix so the version is distinct per test even when\n // the registry briefly has a stale copy from a prior afterEach.\n cy.task('publishPackage', {\n pkgName,\n version: '1.0.0',\n dependencies: { debug: '4.0.0' },\n unique: true,\n }).then((result) => {\n tempFolder = result?.tempFolder ?? null;\n });\n\n loginOnce();\n cy.visit(config.registryUrl);\n });\n\n afterEach(() => {\n // Remove the package from the registry AND the local temp folder.\n // Run both regardless of test outcome so the next test starts\n // clean. `unpublishPackage` treats 404 as success, so a re-run\n // after a half-published state is still safe.\n cy.task('unpublishPackage', { pkgName, tempFolder: tempFolder ?? undefined });\n if (tempFolder) {\n cy.task('cleanupPublished', tempFolder);\n }\n tempFolder = null;\n });\n\n it('should have one published package', () => {\n cy.wait('@pkgs');\n cy.getByTestId(pkg.title).should('have.length.at.least', 1);\n });\n\n it('should navigate to page detail', () => {\n cy.wait('@pkgs');\n cy.wait(300);\n cy.getByTestId(pkg.title).first().click();\n });\n\n it('should have readme content', () => {\n cy.wait('@pkgs');\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@readme');\n cy.wait('@sidebar');\n cy.getByTestId(pkg.readme).should('be.visible');\n cy.get(markdownBody).should('have.length', 1);\n // publishPackage writes a README whose body contains \"e2e testing\".\n cy.contains(markdownBody, /test/);\n cy.contains(`${markdownBody} h1`, pkgName).should('be.visible');\n });\n\n it('should render the sidebar with install commands for npm, yarn, pnpm', () => {\n cy.wait('@pkgs');\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@sidebar');\n cy.getByTestId(pkg.sidebar).should('be.visible');\n cy.getByTestId(pkg.installList).within(() => {\n cy.getByTestId(pkg.installNpm).should('be.visible');\n cy.getByTestId(pkg.installYarn).should('be.visible');\n cy.getByTestId(pkg.installPnpm).should('be.visible');\n });\n cy.getByTestId(pkg.installNpm).should('contain.text', pkgName);\n });\n\n it('should render the sidebar keywords from the published manifest', () => {\n cy.wait('@pkgs');\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@sidebar');\n // publishPackage writes `keywords: ['verdaccio', 'e2e', 'test']`\n // into the generated package.json.\n cy.getByTestId(pkg.keywordList).should('be.visible');\n cy.getByTestId(pkg.keywordList).should('contain.text', 'verdaccio');\n cy.getByTestId(pkg.keywordList).should('contain.text', 'e2e');\n cy.getByTestId(pkg.keywordList).should('contain.text', 'test');\n });\n\n it('should click on dependencies tab', () => {\n cy.wait('@pkgs');\n cy.wait(300);\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@readme');\n cy.wait('@sidebar');\n cy.getByTestId(pkg.dependenciesTab).click();\n cy.wait(100);\n cy.getByTestId(pkg.dependencies).should('have.length', 1);\n // The dep is rendered with its name as testid. This is a dynamic\n // Verdaccio convention (not configurable via testIds map).\n cy.getByTestId('debug').children().invoke('text').should('match', /debug/);\n });\n\n it('should click on versions tab', () => {\n cy.wait('@pkgs');\n cy.wait(300);\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@readme');\n cy.wait('@sidebar');\n cy.getByTestId(pkg.versionsTab).click();\n // With `unique: true` the version becomes `1.0.0-t<timestamp>`,\n // but \"1.0.0\" still appears as a substring — match loosely.\n cy.getByTestId(pkg.tagLatest)\n .children()\n .invoke('text')\n .should('match', /1\\.0\\.0/);\n });\n\n it('should click on uplinks tab', () => {\n cy.wait('@pkgs');\n cy.wait(300);\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@readme');\n cy.wait('@sidebar');\n cy.getByTestId(pkg.uplinksTab).click();\n cy.getByTestId(pkg.noUplinks).should('be.visible');\n });\n });\n}\n"],"mappings":";AAIA,SAAgB,aAAa,QAAwB;CACnD,MAAM,EAAE,QAAQ,SAAS,QAAQ,OAAO;CACxC,MAAM,EAAE,cAAc,gBAAgB,OAAO;AAE7C,UAAS,iBAAiB;EACxB,MAAM,UAAU;EAGhB,IAAI,aAA4B;;;;;;EAOhC,MAAM,kBAAkB;AACtB,MAAG,QACD,CAAC,iBAAiB,OAAO,YAAY,KAAK,QACpC;AACJ,OAAG,MAAM,OAAO,YAAY;AAC5B,OAAG,MAAM,OAAO,YAAY,MAAM,OAAO,YAAY,UAAU;KAC7D,aAAa,OAAO;KACpB,GAAG;KACJ,CAAC;AACF,OAAG,KAAK,QAAQ;MAElB;IACE,WAAW;AACT,QAAG,QAAQ;MACT,KAAK,GAAG,OAAO,YAAY;MAC3B,kBAAkB;MACnB,CAAC,CACC,IAAI,SAAS,CACb,OAAO,YAAY,CAAC,KAAK,IAAI,CAAC;;IAEnC,kBAAkB;IACnB,CACF;;AAGH,mBAAiB;AACf,MAAG,UAAU,QAAQ,yBAAyB,CAAC,GAAG,OAAO;AACzD,MAAG,UAAU,OAAO,6BAA6B,CAAC,GAAG,OAAO;AAC5D,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CACV,OAAO,OAAO,CACd,OAAO,SAAS,UAAU;IAC7B;AAEF,KAAG,qCAAqC;AACtC,MAAG,KAAK,QAAQ;AAChB,MAAG,KAAK,IAAI;AACZ,MAAG,YAAY,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO;AACzC,MAAG,KAAK,UAAU;AAClB,MAAG,KAAK,WAAW;AACnB,MAAG,YAAY,IAAI,WAAW,CAAC,OAAO;AACtC,MAAG,YAAY,IAAI,UAAU,CAAC,OAAO,aAAa;IAClD;GACF"}
1
+ {"version":3,"file":"publish.cjs","names":[],"sources":["../../../src/tests/publish.ts"],"sourcesContent":["/// <reference types=\"cypress\" />\n\nimport { maybeIt } from '../features';\nimport { RegistryConfig } from '../types';\n\nexport function publishTests(config: RegistryConfig) {\n const { header, package: pkg } = config.testIds;\n const { markdownBody, loginDialog } = config.selectors;\n const { features } = config;\n\n describe('publish', () => {\n const pkgName = '@verdaccio/pkg-scoped';\n // Single source of truth for the dependency the publish fixture\n // writes into its package.json. The dependencies-tab assertion\n // reads these back to verify the UI rendered both fields.\n const depName = 'debug';\n const depVersion = '4.0.0';\n // Per-test state so afterEach can clean up the specific publish\n // that this test created (temp folder + registry entry).\n let tempFolder: string | null = null;\n\n /**\n * Log in once, reuse the session across every test in this suite.\n * `cy.session` caches cookies + localStorage keyed on the first\n * argument, so subsequent calls restore without hitting the network.\n */\n const loginOnce = () => {\n cy.session(\n ['publish-suite', config.credentials.user],\n () => {\n cy.visit(config.registryUrl);\n cy.login(config.credentials.user, config.credentials.password, {\n loginButton: header.loginButton,\n ...loginDialog,\n });\n cy.wait('@sign');\n },\n {\n validate() {\n cy.request({\n url: `${config.registryUrl}/-/verdaccio/data/packages`,\n failOnStatusCode: false,\n })\n .its('status')\n .should('be.oneOf', [200, 304]);\n },\n cacheAcrossSpecs: true,\n }\n );\n };\n\n beforeEach(() => {\n cy.intercept('POST', '/-/verdaccio/sec/login').as('sign');\n cy.intercept('GET', '/-/verdaccio/data/packages').as('pkgs');\n cy.intercept('GET', `/-/verdaccio/data/sidebar/${pkgName}`).as('sidebar');\n cy.intercept('GET', `/-/verdaccio/data/package/readme/${pkgName}`).as('readme');\n\n // Publish a fresh copy for this test. `unique: true` appends a\n // timestamp suffix so the version is distinct per test even when\n // the registry briefly has a stale copy from a prior afterEach.\n cy.task('publishPackage', {\n pkgName,\n version: '1.0.0',\n dependencies: { [depName]: depVersion },\n unique: true,\n }).then((result) => {\n tempFolder = result?.tempFolder ?? null;\n });\n\n loginOnce();\n cy.visit(config.registryUrl);\n });\n\n afterEach(() => {\n // Remove the package from the registry AND the local temp folder.\n // Run both regardless of test outcome so the next test starts\n // clean. `unpublishPackage` treats 404 as success, so a re-run\n // after a half-published state is still safe.\n cy.task('unpublishPackage', { pkgName, tempFolder: tempFolder ?? undefined });\n if (tempFolder) {\n cy.task('cleanupPublished', tempFolder);\n }\n tempFolder = null;\n });\n\n it('should have one published package', () => {\n cy.wait('@pkgs');\n cy.getByTestId(pkg.title).should('have.length.at.least', 1);\n });\n\n it('should navigate to page detail', () => {\n cy.wait('@pkgs');\n cy.wait(300);\n cy.getByTestId(pkg.title).first().click();\n });\n\n it('should have readme content', () => {\n cy.wait('@pkgs');\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@readme');\n cy.wait('@sidebar');\n cy.getByTestId(pkg.readme).should('be.visible');\n cy.get(markdownBody).should('have.length', 1);\n // publishPackage writes a README whose body contains \"e2e testing\".\n cy.contains(markdownBody, /test/);\n cy.contains(`${markdownBody} h1`, pkgName).should('be.visible');\n });\n\n it('should render the sidebar with install commands for npm, yarn, pnpm', () => {\n cy.wait('@pkgs');\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@sidebar');\n cy.getByTestId(pkg.sidebar).should('be.visible');\n cy.getByTestId(pkg.installList).within(() => {\n cy.getByTestId(pkg.installNpm).should('be.visible');\n cy.getByTestId(pkg.installYarn).should('be.visible');\n cy.getByTestId(pkg.installPnpm).should('be.visible');\n });\n cy.getByTestId(pkg.installNpm).should('contain.text', pkgName);\n });\n\n it('should render the sidebar keywords from the published manifest', () => {\n cy.wait('@pkgs');\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@sidebar');\n // publishPackage writes `keywords: ['verdaccio', 'e2e', 'test']`\n // into the generated package.json.\n cy.getByTestId(pkg.keywordList).should('be.visible');\n cy.getByTestId(pkg.keywordList).should('contain.text', 'verdaccio');\n cy.getByTestId(pkg.keywordList).should('contain.text', 'e2e');\n cy.getByTestId(pkg.keywordList).should('contain.text', 'test');\n });\n\n it('should click on dependencies tab', () => {\n cy.wait('@pkgs');\n cy.wait(300);\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@readme');\n cy.wait('@sidebar');\n cy.getByTestId(pkg.dependenciesTab).click();\n cy.wait(100);\n cy.getByTestId(pkg.dependencies).should('have.length', 1);\n\n // The dep Chip uses the dep name as its data-testid (dynamic\n // Verdaccio convention, see DependencyBlock.tsx:68), and its\n // label is `\"${name}: ${version}\"` via the `dependencies.\n // dependency-block` i18n key. Assert BOTH fields are rendered.\n cy.getByTestId(depName)\n .should('be.visible')\n .and('contain.text', depName)\n .and('contain.text', depVersion);\n\n // Also verify the Chip text matches the exact \"name: version\"\n // format so a regression in the label template would fail here\n // rather than pass via a loose substring match.\n cy.getByTestId(depName)\n .invoke('text')\n .should('match', new RegExp(`${depName}\\\\s*:\\\\s*${depVersion}`));\n });\n\n it('should click on versions tab', () => {\n cy.wait('@pkgs');\n cy.wait(300);\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@readme');\n cy.wait('@sidebar');\n cy.getByTestId(pkg.versionsTab).click();\n // With `unique: true` the version becomes `1.0.0-t<timestamp>`,\n // but \"1.0.0\" still appears as a substring — match loosely.\n cy.getByTestId(pkg.tagLatest)\n .children()\n .invoke('text')\n .should('match', /1\\.0\\.0/);\n });\n\n it('should click on uplinks tab', () => {\n cy.wait('@pkgs');\n cy.wait(300);\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@readme');\n cy.wait('@sidebar');\n cy.getByTestId(pkg.uplinksTab).click();\n cy.getByTestId(pkg.noUplinks).should('be.visible');\n });\n\n // ── Action-bar FABs: tarball download + raw viewer ─────────────\n // Both buttons live in the sidebar ActionBar. They're gated on\n // `web.showDownloadTarball` / `web.showRaw` (both default to true\n // in the ui-theme's AppConfigurationProvider) and each test is\n // also guarded by a feature flag so branches that ship a\n // different action bar can skip cleanly.\n\n maybeIt(features.publish.downloadTarball)(\n 'should fetch the tarball when the download button is clicked',\n () => {\n // The download provider hits the package manifest's dist.tarball\n // URL directly. For our published fixture the filename looks\n // like `pkg-scoped-1.0.0-t<ts>.tgz`, served from\n // `/<pkg>/-/<filename>.tgz`. Intercept before clicking.\n cy.intercept('GET', '**/pkg-scoped-*.tgz').as('tarballFetch');\n\n cy.wait('@pkgs');\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@sidebar');\n\n cy.getByTestId(pkg.downloadTarballBtn)\n .should('be.visible')\n .click();\n\n // The fetch should fire and return 200. We can't assert on the\n // actual file landing on disk — Cypress doesn't track OS-level\n // downloads — but a successful GET proves the end-to-end path\n // from click → download provider → registry.\n cy.wait('@tarballFetch', { timeout: 10000 })\n .its('response.statusCode')\n .should('eq', 200);\n }\n );\n\n maybeIt(features.publish.rawViewer)(\n 'should open the raw manifest viewer when the raw button is clicked',\n () => {\n cy.wait('@pkgs');\n cy.getByTestId(pkg.title).first().click();\n cy.wait('@sidebar');\n\n // RawViewer is a full-screen MUI Dialog — initially unmounted\n // because `isOpen=false` keeps Dialog closed and Cypress won't\n // find it. Clicking the FAB flips `isOpen` to true.\n cy.getByTestId(pkg.rawBtn).should('be.visible').click();\n\n cy.getByTestId(pkg.rawViewerDialog, { timeout: 5000 }).should(\n 'be.visible'\n );\n // The ReactJson viewer renders the package manifest — the\n // package name should appear somewhere in the serialized JSON.\n cy.getByTestId(pkg.rawViewerDialog).should('contain.text', pkgName);\n\n // Close via the X button and confirm the dialog goes away so\n // subsequent tests don't inherit an open overlay.\n cy.getByTestId(pkg.clos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MAAG,YAAY,IAAI,UAAU,CAAC,OAAO,aAAa;IAClD;AASF,mBAAA,QAAQ,SAAS,QAAQ,gBAAgB,CACvC,sEACM;AAKJ,MAAG,UAAU,OAAO,sBAAsB,CAAC,GAAG,eAAe;AAE7D,MAAG,KAAK,QAAQ;AAChB,MAAG,YAAY,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO;AACzC,MAAG,KAAK,WAAW;AAEnB,MAAG,YAAY,IAAI,mBAAmB,CACnC,OAAO,aAAa,CACpB,OAAO;AAMV,MAAG,KAAK,iBAAiB,EAAE,SAAS,KAAO,CAAC,CACzC,IAAI,sBAAsB,CAC1B,OAAO,MAAM,IAAI;IAEvB;AAED,mBAAA,QAAQ,SAAS,QAAQ,UAAU,CACjC,4EACM;AACJ,MAAG,KAAK,QAAQ;AAChB,MAAG,YAAY,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO;AACzC,MAAG,KAAK,WAAW;AAKnB,MAAG,YAAY,IAAI,OAAO,CAAC,OAAO,aAAa,CAAC,OAAO;AAEvD,MAAG,YAAY,IAAI,iBAAiB,EAAE,SAAS,KAAM,CAAC,CAAC,OACrD,aACD;AAGD,MAAG,YAAY,IAAI,gBAAgB,CAAC,OAAO,gBAAgB,QAAQ;AAInE,MAAG,YAAY,IAAI,eAAe,CAAC,OAAO;AAC1C,MAAG,YAAY,IAAI,gBAAgB,CAAC,OAAO,YAAY;IAE1D;GACD"}
@@ -1,3 +1,4 @@
1
+ const require_features = require("../features.cjs");
1
2
  //#region src/tests/search.ts
2
3
  /**
3
4
  * UI tests for the Verdaccio search box.
@@ -8,6 +9,8 @@
8
9
  * a real package in the registry should live in publishTests instead.
9
10
  */
10
11
  function searchTests(config) {
12
+ const { features } = config;
13
+ const { package: pkg } = config.testIds;
11
14
  describe("search", () => {
12
15
  beforeEach(() => {
13
16
  cy.intercept("GET", "**/-/verdaccio/data/search/**").as("webSearch");
@@ -43,6 +46,51 @@ function searchTests(config) {
43
46
  expect(interception.request.url).to.contain("second-query");
44
47
  });
45
48
  });
49
+ describe("with a published package", () => {
50
+ const pkgName = "@verdaccio/search-fixture";
51
+ const pkgSlug = "search-fixture";
52
+ let tempFolder = null;
53
+ beforeEach(() => {
54
+ cy.task("publishPackage", {
55
+ pkgName,
56
+ version: "1.0.0",
57
+ unique: true
58
+ }).then((result) => {
59
+ tempFolder = result?.tempFolder ?? null;
60
+ });
61
+ cy.visit(config.registryUrl);
62
+ });
63
+ afterEach(() => {
64
+ cy.task("unpublishPackage", {
65
+ pkgName,
66
+ tempFolder: tempFolder ?? void 0
67
+ });
68
+ if (tempFolder) cy.task("cleanupPublished", tempFolder);
69
+ tempFolder = null;
70
+ });
71
+ require_features.maybeIt(features.search.resultsDropdown)("should display the matching package in the results dropdown", () => {
72
+ getSearchInput().clear().type(pkgSlug, { delay: 30 });
73
+ cy.wait(anySearchAlias(), { timeout: 1e4 }).then((interception) => {
74
+ expect(interception.request.url).to.contain(pkgSlug);
75
+ });
76
+ cy.get("[role=\"listbox\"]", { timeout: 5e3 }).should("be.visible");
77
+ cy.get("[role=\"listbox\"] [role=\"option\"]").should("have.length.at.least", 1);
78
+ cy.contains("[role=\"listbox\"] [role=\"option\"]", pkgName).should("be.visible");
79
+ });
80
+ require_features.maybeIt(features.search.resultClickNavigation)("should navigate to the package detail page when a result is clicked", () => {
81
+ cy.intercept("GET", `/-/verdaccio/data/sidebar/${pkgName}`).as("detailSidebar");
82
+ cy.intercept("GET", `/-/verdaccio/data/package/readme/${pkgName}`).as("detailReadme");
83
+ getSearchInput().clear().type(pkgSlug, { delay: 30 });
84
+ cy.wait(anySearchAlias(), { timeout: 1e4 });
85
+ cy.contains("[role=\"listbox\"] [role=\"option\"]", pkgName).should("be.visible").click();
86
+ cy.location("pathname").should("contain", "/-/web/detail");
87
+ cy.location("pathname").should("contain", "search-fixture");
88
+ cy.wait("@detailSidebar", { timeout: 1e4 });
89
+ cy.wait("@detailReadme", { timeout: 1e4 });
90
+ cy.getByTestId(pkg.sidebar).should("be.visible");
91
+ cy.getByTestId(pkg.readme).should("be.visible");
92
+ });
93
+ });
46
94
  });
47
95
  }
48
96
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"search.cjs","names":[],"sources":["../../../src/tests/search.ts"],"sourcesContent":["/// <reference types=\"cypress\" />\n\nimport { RegistryConfig } from '../types';\n\n/**\n * UI tests for the Verdaccio search box.\n *\n * These tests do NOT depend on any published package — they assert the\n * search *flow* (input exists, typing triggers the search API, results\n * region updates) rather than specific package metadata. Tests that need\n * a real package in the registry should live in publishTests instead.\n */\nexport function searchTests(config: RegistryConfig) {\n describe('search', () => {\n beforeEach(() => {\n // Verdaccio's search endpoint — covers both the web API and the\n // npm v1 search API, depending on which one the UI calls.\n cy.intercept('GET', '**/-/verdaccio/data/search/**').as('webSearch');\n cy.intercept('GET', '**/-/v1/search**').as('v1Search');\n cy.intercept('GET', '**/-/verdaccio/data/packages').as('pkgs');\n\n cy.visit(config.registryUrl);\n cy.get('body').should('be.visible');\n });\n\n it('should render the search input', () => {\n getSearchInput().should('be.visible');\n });\n\n it('should fire a search request when typing a query', () => {\n const query = 'verdaccio';\n\n getSearchInput().clear().type(query, { delay: 30 });\n\n // Whichever endpoint the UI is wired to, at least one should hit.\n cy.wait(anySearchAlias(), { timeout: 10000 }).then((interception: any) => {\n expect(interception.request.url).to.contain(query);\n });\n });\n\n it('should show a \"no results\" state for an impossible query', () => {\n const query = 'xyzzy-no-such-package-' + Date.now();\n\n getSearchInput().clear().type(query, { delay: 30 });\n cy.wait(anySearchAlias(), { timeout: 10000 });\n\n // Give the UI a tick to render the empty state.\n cy.wait(300);\n\n // The UI may render \"No Match\", \"No results\", or similar — match\n // loosely rather than binding to one exact string.\n cy.contains(/no\\s+(match|results|packages)/i, { timeout: 5000 }).should(\n 'be.visible'\n );\n });\n\n it('should clear the query and allow typing a new one', () => {\n getSearchInput().clear().type('first-query', { delay: 20 });\n cy.wait(anySearchAlias(), { timeout: 10000 });\n\n // Clearing should empty the input value. We deliberately do NOT\n // assert on the autocomplete dropdown's empty-state text: on a\n // registry with no packages published it lingers regardless of\n // the input value, which previously caused a false positive.\n getSearchInput().clear();\n getSearchInput().should('have.value', '');\n\n // Typing a fresh query must fire another search request so the\n // search box is still functional after a clear.\n getSearchInput().type('second-query', { delay: 20 });\n cy.wait(anySearchAlias(), { timeout: 10000 }).then(\n (interception: any) => {\n expect(interception.request.url).to.contain('second-query');\n }\n );\n });\n });\n}\n\n/**\n * Resolve the search input. Verdaccio 6 renders it with different\n * data-testid values across versions, so we try a few in order before\n * falling back to a generic role/type selector.\n */\nfunction getSearchInput() {\n return cy.get(\n [\n '[data-testid=\"search-input\"]',\n '[data-testid=\"header--input-search\"]',\n '[data-testid=\"autoCompleteSearch\"] input',\n 'input[aria-label*=\"earch\"]',\n 'input[placeholder*=\"earch\"]',\n 'input[type=\"search\"]',\n ].join(', '),\n { timeout: 10000 }\n );\n}\n\n/**\n * Cypress `cy.wait` only accepts one alias at a time, so pick whichever\n * alias fires first. This helper lets us stay agnostic to which search\n * endpoint the UI is wired to.\n */\nfunction anySearchAlias(): string {\n // In practice most Verdaccio 6 builds call the web search endpoint;\n // prefer that one and let the test fail loud if neither fires.\n return '@webSearch';\n}\n"],"mappings":";;;;;;;;;AAYA,SAAgB,YAAY,QAAwB;AAClD,UAAS,gBAAgB;AACvB,mBAAiB;AAGf,MAAG,UAAU,OAAO,gCAAgC,CAAC,GAAG,YAAY;AACpE,MAAG,UAAU,OAAO,mBAAmB,CAAC,GAAG,WAAW;AACtD,MAAG,UAAU,OAAO,+BAA+B,CAAC,GAAG,OAAO;AAE9D,MAAG,MAAM,OAAO,YAAY;AAC5B,MAAG,IAAI,OAAO,CAAC,OAAO,aAAa;IACnC;AAEF,KAAG,wCAAwC;AACzC,mBAAgB,CAAC,OAAO,aAAa;IACrC;AAEF,KAAG,0DAA0D;GAC3D,MAAM,QAAQ;AAEd,mBAAgB,CAAC,OAAO,CAAC,KAAK,OAAO,EAAE,OAAO,IAAI,CAAC;AAGnD,MAAG,KAAK,gBAAgB,EAAE,EAAE,SAAS,KAAO,CAAC,CAAC,MAAM,iBAAsB;AACxE,WAAO,aAAa,QAAQ,IAAI,CAAC,GAAG,QAAQ,MAAM;KAClD;IACF;AAEF,KAAG,oEAAkE;GACnE,MAAM,QAAQ,2BAA2B,KAAK,KAAK;AAEnD,mBAAgB,CAAC,OAAO,CAAC,KAAK,OAAO,EAAE,OAAO,IAAI,CAAC;AACnD,MAAG,KAAK,gBAAgB,EAAE,EAAE,SAAS,KAAO,CAAC;AAG7C,MAAG,KAAK,IAAI;AAIZ,MAAG,SAAS,kCAAkC,EAAE,SAAS,KAAM,CAAC,CAAC,OAC/D,aACD;IACD;AAEF,KAAG,2DAA2D;AAC5D,mBAAgB,CAAC,OAAO,CAAC,KAAK,eAAe,EAAE,OAAO,IAAI,CAAC;AAC3D,MAAG,KAAK,gBAAgB,EAAE,EAAE,SAAS,KAAO,CAAC;AAM7C,mBAAgB,CAAC,OAAO;AACxB,mBAAgB,CAAC,OAAO,cAAc,GAAG;AAIzC,mBAAgB,CAAC,KAAK,gBAAgB,EAAE,OAAO,IAAI,CAAC;AACpD,MAAG,KAAK,gBAAgB,EAAE,EAAE,SAAS,KAAO,CAAC,CAAC,MAC3C,iBAAsB;AACrB,WAAO,aAAa,QAAQ,IAAI,CAAC,GAAG,QAAQ,eAAe;KAE9D;IACD;GACF;;;;;;;AAQJ,SAAS,iBAAiB;AACxB,QAAO,GAAG,IACR;EACE;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,KAAK,EACZ,EAAE,SAAS,KAAO,CACnB;;;;;;;AAQH,SAAS,iBAAyB;AAGhC,QAAO"}
1
+ {"version":3,"file":"search.cjs","names":[],"sources":["../../../src/tests/search.ts"],"sourcesContent":["/// <reference types=\"cypress\" />\n\nimport { maybeIt } from '../features';\nimport { RegistryConfig } from '../types';\n\n/**\n * UI tests for the Verdaccio search box.\n *\n * These tests do NOT depend on any published package — they assert the\n * search *flow* (input exists, typing triggers the search API, results\n * region updates) rather than specific package metadata. Tests that need\n * a real package in the registry should live in publishTests instead.\n */\nexport function searchTests(config: RegistryConfig) {\n const { features } = config;\n const { package: pkg } = config.testIds;\n\n describe('search', () => {\n beforeEach(() => {\n // Verdaccio's search endpoint — covers both the web API and the\n // npm v1 search API, depending on which one the UI calls.\n cy.intercept('GET', '**/-/verdaccio/data/search/**').as('webSearch');\n cy.intercept('GET', '**/-/v1/search**').as('v1Search');\n cy.intercept('GET', '**/-/verdaccio/data/packages').as('pkgs');\n\n cy.visit(config.registryUrl);\n cy.get('body').should('be.visible');\n });\n\n it('should render the search input', () => {\n getSearchInput().should('be.visible');\n });\n\n it('should fire a search request when typing a query', () => {\n const query = 'verdaccio';\n\n getSearchInput().clear().type(query, { delay: 30 });\n\n // Whichever endpoint the UI is wired to, at least one should hit.\n cy.wait(anySearchAlias(), { timeout: 10000 }).then((interception: any) => {\n expect(interception.request.url).to.contain(query);\n });\n });\n\n it('should show a \"no results\" state for an impossible query', () => {\n const query = 'xyzzy-no-such-package-' + Date.now();\n\n getSearchInput().clear().type(query, { delay: 30 });\n cy.wait(anySearchAlias(), { timeout: 10000 });\n\n // Give the UI a tick to render the empty state.\n cy.wait(300);\n\n // The UI may render \"No Match\", \"No results\", or similar — match\n // loosely rather than binding to one exact string.\n cy.contains(/no\\s+(match|results|packages)/i, { timeout: 5000 }).should(\n 'be.visible'\n );\n });\n\n it('should clear the query and allow typing a new one', () => {\n getSearchInput().clear().type('first-query', { delay: 20 });\n cy.wait(anySearchAlias(), { timeout: 10000 });\n\n // Clearing should empty the input value. We deliberately do NOT\n // assert on the autocomplete dropdown's empty-state text: on a\n // registry with no packages published it lingers regardless of\n // the input value, which previously caused a false positive.\n getSearchInput().clear();\n getSearchInput().should('have.value', '');\n\n // Typing a fresh query must fire another search request so the\n // search box is still functional after a clear.\n getSearchInput().type('second-query', { delay: 20 });\n cy.wait(anySearchAlias(), { timeout: 10000 }).then(\n (interception: any) => {\n expect(interception.request.url).to.contain('second-query');\n }\n );\n });\n\n // ── Rendering assertions that require real package data ────────\n // Publishes a throwaway package before each test and unpublishes\n // after so the outer \"no results\" test still sees a clean registry.\n // The search query uses a substring of the package name to avoid\n // scope-parsing issues with `@` / `/` characters in the URL.\n describe('with a published package', () => {\n const pkgName = '@verdaccio/search-fixture';\n // Unique slug we can type into the search box — must be a\n // substring of pkgName so Verdaccio's search matches it.\n const pkgSlug = 'search-fixture';\n let tempFolder: string | null = null;\n\n beforeEach(() => {\n cy.task('publishPackage', {\n pkgName,\n version: '1.0.0',\n unique: true,\n }).then((result) => {\n tempFolder = result?.tempFolder ?? null;\n });\n cy.visit(config.registryUrl);\n });\n\n afterEach(() => {\n cy.task('unpublishPackage', {\n pkgName,\n tempFolder: tempFolder ?? undefined,\n });\n if (tempFolder) {\n cy.task('cleanupPublished', tempFolder);\n }\n tempFolder = null;\n });\n\n maybeIt(features.search.resultsDropdown)(\n 'should display the matching package in the results dropdown',\n () => {\n getSearchInput().clear().type(pkgSlug, { delay: 30 });\n\n // Wait for the search request to resolve with results.\n cy.wait(anySearchAlias(), { timeout: 10000 }).then(\n (interception: any) => {\n expect(interception.request.url).to.contain(pkgSlug);\n }\n );\n\n // MUI Autocomplete opens a listbox with role=\"listbox\" when\n // there are matching options. Each result renders with\n // role=\"option\". No data-testids on the dropdown itself, so\n // we lean on the ARIA roles which are stable across MUI\n // versions.\n cy.get('[role=\"listbox\"]', { timeout: 5000 }).should('be.visible');\n cy.get('[role=\"listbox\"] [role=\"option\"]').should(\n 'have.length.at.least',\n 1\n );\n // The result item must contain the full package name.\n cy.contains('[role=\"listbox\"] [role=\"option\"]', pkgName).should(\n 'be.visible'\n );\n }\n );\n\n maybeIt(features.search.resultClickNavigation)(\n 'should navigate to the package detail page when a result is clicked',\n () => {\n // Intercept the two data endpoints that the detail route\n // fetches on mount. Waiting on these is the most reliable\n // way to know the router actually resolved the new page\n // (not just changed the URL).\n cy.intercept('GET', `/-/verdaccio/data/sidebar/${pkgName}`).as(\n 'detailSidebar'\n );\n cy.intercept(\n 'GET',\n `/-/verdaccio/data/package/readme/${pkgName}`\n ).as('detailReadme');\n\n getSearchInput().clear().type(pkgSlug, { delay: 30 });\n cy.wait(anySearchAlias(), { timeout: 10000 });\n\n cy.contains('[role=\"listbox\"] [role=\"option\"]', pkgName)\n .should('be.visible')\n .click();\n\n // Verdaccio routes package detail under /-/web/detail/<pkg>.\n cy.location('pathname').should('contain', '/-/web/detail');\n cy.location('pathname').should('contain', 'search-fixture');\n\n // Wait for the detail page's own fetches to settle so\n // assertions don't race the async content.\n cy.wait('@detailSidebar', { timeout: 10000 });\n cy.wait('@detailReadme', { timeout: 10000 });\n\n // Detail page rendered both panes end-to-end.\n cy.getByTestId(pkg.sidebar).should('be.visible');\n cy.getByTestId(pkg.readme).should('be.visible');\n }\n );\n });\n });\n}\n\n/**\n * Resolve the search input. Verdaccio 6 renders it with different\n * data-testid values across versions, so we try a few in order before\n * falling back to a generic role/type selector.\n */\nfunction getSearchInput() {\n return cy.get(\n [\n '[data-testid=\"search-input\"]',\n '[data-testid=\"header--input-search\"]',\n '[data-testid=\"autoCompleteSearch\"] input',\n 'input[aria-label*=\"earch\"]',\n 'input[placeholder*=\"earch\"]',\n 'input[type=\"search\"]',\n ].join(', '),\n { timeout: 10000 }\n );\n}\n\n/**\n * Cypress `cy.wait` only accepts one alias at a time, so pick whichever\n * alias fires first. This helper lets us stay agnostic to which search\n * endpoint the UI is wired to.\n */\nfunction anySearchAlias(): string {\n // In practice most Verdaccio 6 builds call the web search endpoint;\n // prefer that one and let the test fail loud if neither fires.\n return '@webSearch';\n}\n"],"mappings":";;;;;;;;;;AAaA,SAAgB,YAAY,QAAwB;CAClD,MAAM,EAAE,aAAa;CACrB,MAAM,EAAE,SAAS,QAAQ,OAAO;AAEhC,UAAS,gBAAgB;AACvB,mBAAiB;AAGf,MAAG,UAAU,OAAO,gCAAgC,CAAC,GAAG,YAAY;AACpE,MAAG,UAAU,OAAO,mBAAmB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OAAG,KAAK,kBAAkB,EAAE,SAAS,KAAO,CAAC;AAC7C,OAAG,KAAK,iBAAiB,EAAE,SAAS,KAAO,CAAC;AAG5C,OAAG,YAAY,IAAI,QAAQ,CAAC,OAAO,aAAa;AAChD,OAAG,YAAY,IAAI,OAAO,CAAC,OAAO,aAAa;KAElD;IACD;GACF;;;;;;;AAQJ,SAAS,iBAAiB;AACxB,QAAO,GAAG,IACR;EACE;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,KAAK,EACZ,EAAE,SAAS,KAAO,CACnB;;;;;;;AAQH,SAAS,iBAAyB;AAGhC,QAAO"}
@@ -1,3 +1,4 @@
1
+ const require_features = require("../features.cjs");
1
2
  //#region src/tests/settings.ts
2
3
  /**
3
4
  * Tests for the header Settings dialog and the Translations (language)
@@ -18,6 +19,7 @@
18
19
  */
19
20
  function settingsTests(config) {
20
21
  const { header } = config.testIds;
22
+ const { features } = config;
21
23
  describe("settings & language", () => {
22
24
  beforeEach(() => {
23
25
  cy.visit(config.registryUrl);
@@ -42,7 +44,7 @@ function settingsTests(config) {
42
44
  cy.contains("[role=\"dialog\"]", "English").should("be.visible");
43
45
  cy.contains("[role=\"dialog\"]", "German").should("be.visible");
44
46
  });
45
- it("should change the UI language when a language card is clicked", () => {
47
+ require_features.maybeIt(features.settings.languageSwitcher)("should change the UI language when a language card is clicked", () => {
46
48
  cy.getByTestId(header.settingsTooltip).click();
47
49
  cy.get("[role=\"dialog\"]").should("be.visible");
48
50
  cy.contains("[role=\"dialog\"] [role=\"tab\"]", "Translations").click();