@verdaccio/e2e-ui 2.7.0 → 2.9.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.
- package/README.md +13 -8
- package/build/cjs/features.cjs +19 -0
- package/build/cjs/features.cjs.map +1 -1
- package/build/cjs/index.cjs +6 -0
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/testIds.cjs +25 -1
- package/build/cjs/testIds.cjs.map +1 -1
- package/build/cjs/tests/change-password.cjs +20 -6
- package/build/cjs/tests/change-password.cjs.map +1 -1
- package/build/cjs/tests/home-detail-ux.cjs +166 -0
- package/build/cjs/tests/home-detail-ux.cjs.map +1 -0
- package/build/cjs/tests/index.cjs +4 -0
- package/build/cjs/tests/provenance.cjs +134 -0
- package/build/cjs/tests/provenance.cjs.map +1 -0
- package/build/cjs/tests/publish.cjs +1 -1
- package/build/cjs/tests/publish.cjs.map +1 -1
- package/build/cjs/tests/settings.cjs +5 -2
- package/build/cjs/tests/settings.cjs.map +1 -1
- package/build/esm/features.js +19 -0
- package/build/esm/features.js.map +1 -1
- package/build/esm/index.js +5 -1
- package/build/esm/index.js.map +1 -1
- package/build/esm/testIds.js +25 -1
- package/build/esm/testIds.js.map +1 -1
- package/build/esm/tests/change-password.js +20 -6
- package/build/esm/tests/change-password.js.map +1 -1
- package/build/esm/tests/home-detail-ux.js +166 -0
- package/build/esm/tests/home-detail-ux.js.map +1 -0
- package/build/esm/tests/index.js +3 -1
- package/build/esm/tests/provenance.js +134 -0
- package/build/esm/tests/provenance.js.map +1 -0
- package/build/esm/tests/publish.js +1 -1
- package/build/esm/tests/publish.js.map +1 -1
- package/build/esm/tests/settings.js +5 -2
- package/build/esm/tests/settings.js.map +1 -1
- package/build/features.d.ts +57 -0
- package/build/index.d.ts +1 -1
- package/build/testIds.d.ts +38 -0
- package/build/tests/home-detail-ux.d.ts +10 -0
- package/build/tests/index.d.ts +2 -0
- package/build/tests/provenance.d.ts +13 -0
- package/package.json +1 -1
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
const require_features = require("../features.cjs");
|
|
2
|
+
//#region src/tests/home-detail-ux.ts
|
|
3
|
+
/**
|
|
4
|
+
* Home and package page UX that ships with the 9.x web UI: the package
|
|
5
|
+
* list toolbar, the tab in the address, the welcome guide, the install
|
|
6
|
+
* box (bun and `.npmrc`), copy feedback and search grouped by origin.
|
|
7
|
+
*
|
|
8
|
+
* Every test is a probe (flag defaults to `false`): released lines do
|
|
9
|
+
* not have these features yet.
|
|
10
|
+
*/
|
|
11
|
+
function homeDetailUxTests(config) {
|
|
12
|
+
const { features } = config;
|
|
13
|
+
const flags = features.homeDetailUx;
|
|
14
|
+
const { header, home, package: pkg, search } = config.testIds;
|
|
15
|
+
describe("home and detail ux", () => {
|
|
16
|
+
describe("with an empty registry", () => {
|
|
17
|
+
beforeEach(() => {
|
|
18
|
+
cy.intercept("GET", "/-/verdaccio/data/packages").as("pkgs");
|
|
19
|
+
cy.visit(config.registryUrl);
|
|
20
|
+
cy.wait("@pkgs");
|
|
21
|
+
});
|
|
22
|
+
require_features.maybeIt(flags.welcomeGuide)("should guide the first publish with a setup tab per package manager", () => {
|
|
23
|
+
cy.getByTestId(home.helpCard, { timeout: 1e4 }).should("be.visible");
|
|
24
|
+
cy.getByTestId(home.helpCard).contains("No Package Published Yet.");
|
|
25
|
+
cy.getByTestId(home.helpCard).contains(`npm adduser --registry ${config.registryUrl}`);
|
|
26
|
+
cy.getByTestId(home.helpCard).contains(`npm publish --registry ${config.registryUrl}`);
|
|
27
|
+
cy.getByTestId(`${home.helpSetupTabPrefix}npm`).should("be.visible");
|
|
28
|
+
cy.getByTestId(home.helpCard).contains(`npm config set registry ${config.registryUrl}`);
|
|
29
|
+
cy.get(`[data-testid="${home.helpSetupTabPrefix}.npmrc"]`).click();
|
|
30
|
+
cy.getByTestId(home.helpCard).contains(`registry=${config.registryUrl}`);
|
|
31
|
+
cy.getByTestId(home.helpUplinksNote).should("be.visible");
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
describe("with packages from two scopes", () => {
|
|
35
|
+
const scopedPkg = "@verdaccio/ux-toolbar-fixture";
|
|
36
|
+
const unscopedPkg = "ux-toolbar-unscoped-fixture";
|
|
37
|
+
const tempFolders = [];
|
|
38
|
+
before(() => {
|
|
39
|
+
if (!flags.homeToolbar) return;
|
|
40
|
+
[scopedPkg, unscopedPkg].forEach((pkgName) => {
|
|
41
|
+
cy.task("publishPackage", {
|
|
42
|
+
pkgName,
|
|
43
|
+
version: "1.0.0",
|
|
44
|
+
unique: true
|
|
45
|
+
}).then((r) => {
|
|
46
|
+
if (r?.tempFolder) tempFolders.push(r.tempFolder);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
after(() => {
|
|
51
|
+
if (!flags.homeToolbar) return;
|
|
52
|
+
[scopedPkg, unscopedPkg].forEach((pkgName) => cy.task("unpublishPackage", pkgName));
|
|
53
|
+
cy.then(() => tempFolders.forEach((folder) => cy.task("cleanupPublished", folder)));
|
|
54
|
+
});
|
|
55
|
+
beforeEach(() => {
|
|
56
|
+
cy.intercept("GET", "/-/verdaccio/data/packages").as("pkgs");
|
|
57
|
+
});
|
|
58
|
+
require_features.maybeIt(flags.homeToolbar)("should filter the list and keep the filter in ?q=", () => {
|
|
59
|
+
cy.visit(config.registryUrl);
|
|
60
|
+
cy.wait("@pkgs");
|
|
61
|
+
cy.getByTestId(home.packageListToolbar, { timeout: 1e4 }).should("be.visible");
|
|
62
|
+
cy.getByTestId(pkg.title).should("have.length", 2);
|
|
63
|
+
cy.getByTestId(home.packageListFilter).type("unscoped", { delay: 20 });
|
|
64
|
+
cy.getByTestId(pkg.title).should("have.length", 1).and("contain", unscopedPkg);
|
|
65
|
+
cy.location("search").should("eq", "?q=unscoped");
|
|
66
|
+
cy.reload();
|
|
67
|
+
cy.getByTestId(home.packageListFilter, { timeout: 1e4 }).should("have.value", "unscoped");
|
|
68
|
+
cy.getByTestId(pkg.title).should("have.length", 1);
|
|
69
|
+
});
|
|
70
|
+
require_features.maybeIt(flags.homeToolbar)("should restore the scope from ?scope=", () => {
|
|
71
|
+
cy.visit(`${config.registryUrl}/?scope=@verdaccio`);
|
|
72
|
+
cy.wait("@pkgs");
|
|
73
|
+
cy.getByTestId(home.packageListScope, { timeout: 1e4 }).should("have.value", "@verdaccio");
|
|
74
|
+
cy.getByTestId(pkg.title).should("have.length", 1).and("contain", scopedPkg);
|
|
75
|
+
});
|
|
76
|
+
require_features.maybeIt(flags.homeToolbar)("should say nothing matches instead of showing the onboarding card", () => {
|
|
77
|
+
cy.visit(`${config.registryUrl}/?q=no-package-matches-this`);
|
|
78
|
+
cy.wait("@pkgs");
|
|
79
|
+
cy.getByTestId(home.packageListNoMatch, { timeout: 1e4 }).should("be.visible");
|
|
80
|
+
cy.getByTestId(home.helpCard).should("not.exist");
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
describe("with a published package", () => {
|
|
84
|
+
const pkgName = "@verdaccio/ux-detail-fixture";
|
|
85
|
+
const detailUrl = `${config.registryUrl}/-/web/detail/${pkgName}`;
|
|
86
|
+
const needsPackage = flags.detailTabInUrl || flags.installBunAndNpmrc || flags.copyFeedback || flags.searchGrouping || flags.versionLink || flags.settingsPublishTab;
|
|
87
|
+
let tempFolder = null;
|
|
88
|
+
let version = "1.0.0";
|
|
89
|
+
before(() => {
|
|
90
|
+
if (!needsPackage) return;
|
|
91
|
+
cy.task("publishPackage", {
|
|
92
|
+
pkgName,
|
|
93
|
+
version: "1.0.0",
|
|
94
|
+
dependencies: { debug: "4.0.0" },
|
|
95
|
+
unique: true
|
|
96
|
+
}).then((result) => {
|
|
97
|
+
tempFolder = result?.tempFolder ?? null;
|
|
98
|
+
version = result?.version ?? version;
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
after(() => {
|
|
102
|
+
if (!needsPackage) return;
|
|
103
|
+
cy.task("unpublishPackage", {
|
|
104
|
+
pkgName,
|
|
105
|
+
tempFolder: tempFolder ?? void 0
|
|
106
|
+
});
|
|
107
|
+
cy.then(() => {
|
|
108
|
+
if (tempFolder) cy.task("cleanupPublished", tempFolder);
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
require_features.maybeIt(flags.settingsPublishTab)("should keep the publishing guide in the settings once packages exist", () => {
|
|
112
|
+
cy.visit(config.registryUrl);
|
|
113
|
+
cy.getByTestId(pkg.itemList, { timeout: 1e4 }).should("exist");
|
|
114
|
+
cy.getByTestId(header.settingsTooltip).click();
|
|
115
|
+
cy.getByTestId(header.settingsPublishTab).click();
|
|
116
|
+
cy.getByTestId(header.settingsPublishPanel).within(() => {
|
|
117
|
+
cy.getByTestId(home.helpGuide).should("be.visible");
|
|
118
|
+
cy.contains(`npm publish --registry ${config.registryUrl}`).scrollIntoView().should("be.visible");
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
require_features.maybeIt(flags.versionLink)("should open the version page from the home list", () => {
|
|
122
|
+
cy.visit(config.registryUrl);
|
|
123
|
+
cy.contains(`[data-testid="${pkg.itemList}"]`, pkgName, { timeout: 1e4 }).find(`[data-testid="${pkg.versionLink}"]`).click();
|
|
124
|
+
cy.location("pathname").should("eq", `/-/web/detail/${pkgName}/v/${version}`);
|
|
125
|
+
cy.getByTestId(pkg.sidebar, { timeout: 1e4 }).contains(version);
|
|
126
|
+
});
|
|
127
|
+
require_features.maybeIt(flags.detailTabInUrl)("should keep the selected tab in ?tab=", () => {
|
|
128
|
+
cy.visit(detailUrl);
|
|
129
|
+
cy.getByTestId(pkg.versionsTab, { timeout: 1e4 }).click();
|
|
130
|
+
cy.location("search").should("contain", "tab=versions");
|
|
131
|
+
cy.getByTestId(pkg.tagLatest).should("be.visible");
|
|
132
|
+
cy.getByTestId(pkg.readmeTab).click();
|
|
133
|
+
cy.location("search").should("not.contain", "tab=");
|
|
134
|
+
});
|
|
135
|
+
require_features.maybeIt(flags.detailTabInUrl)("should open the tab a link points to", () => {
|
|
136
|
+
cy.visit(`${detailUrl}?tab=dependencies`);
|
|
137
|
+
cy.getByTestId(pkg.dependenciesTab, { timeout: 1e4 }).should("have.attr", "aria-selected", "true");
|
|
138
|
+
cy.getByTestId(pkg.dependencies).contains("debug");
|
|
139
|
+
});
|
|
140
|
+
require_features.maybeIt(flags.installBunAndNpmrc)("should offer bun and the scoped .npmrc line in the install box", () => {
|
|
141
|
+
cy.visit(detailUrl);
|
|
142
|
+
cy.getByTestId(pkg.installBun, { timeout: 1e4 }).contains(`bun add ${pkgName}`);
|
|
143
|
+
cy.getByTestId(pkg.installNpmrc).contains(`@verdaccio:registry=${config.registryUrl}`);
|
|
144
|
+
});
|
|
145
|
+
require_features.maybeIt(flags.copyFeedback)("should confirm a copy on the copy button", () => {
|
|
146
|
+
cy.visit(detailUrl);
|
|
147
|
+
cy.getByTestId(pkg.installNpmrcCopy, { timeout: 1e4 }).click();
|
|
148
|
+
cy.getByTestId(pkg.installNpmrcCopy).should("have.attr", "aria-label", "Copied");
|
|
149
|
+
});
|
|
150
|
+
require_features.maybeIt(flags.searchGrouping)("should list a package published here under its own search group", () => {
|
|
151
|
+
cy.intercept("GET", "**/-/verdaccio/data/search/**").as("webSearch");
|
|
152
|
+
cy.visit(config.registryUrl);
|
|
153
|
+
cy.get("input[placeholder*=\"earch\"]", { timeout: 1e4 }).type("ux-detail-fixture", { delay: 30 });
|
|
154
|
+
cy.wait("@webSearch", { timeout: 1e4 });
|
|
155
|
+
cy.get("[role=\"listbox\"]", { timeout: 5e3 }).within(() => {
|
|
156
|
+
cy.getByTestId(`${search.groupPrefix}private`).should("be.visible");
|
|
157
|
+
cy.contains("[role=\"option\"]", pkgName).find(`[data-testid="${search.originPrefix}private"]`).should("exist");
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
//#endregion
|
|
164
|
+
exports.homeDetailUxTests = homeDetailUxTests;
|
|
165
|
+
|
|
166
|
+
//# sourceMappingURL=home-detail-ux.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"home-detail-ux.cjs","names":[],"sources":["../../../src/tests/home-detail-ux.ts"],"sourcesContent":["/// <reference types=\"cypress\" />\nimport { maybeIt } from '../features';\nimport { RegistryConfig } from '../types';\n\n/**\n * Home and package page UX that ships with the 9.x web UI: the package\n * list toolbar, the tab in the address, the welcome guide, the install\n * box (bun and `.npmrc`), copy feedback and search grouped by origin.\n *\n * Every test is a probe (flag defaults to `false`): released lines do\n * not have these features yet.\n */\nexport function homeDetailUxTests(config: RegistryConfig) {\n const { features } = config;\n const flags = features.homeDetailUx;\n const { header, home, package: pkg, search } = config.testIds;\n\n describe('home and detail ux', () => {\n describe('with an empty registry', () => {\n beforeEach(() => {\n cy.intercept('GET', '/-/verdaccio/data/packages').as('pkgs');\n cy.visit(config.registryUrl);\n cy.wait('@pkgs');\n });\n\n maybeIt(flags.welcomeGuide)(\n 'should guide the first publish with a setup tab per package manager',\n () => {\n cy.getByTestId(home.helpCard, { timeout: 10000 }).should('be.visible');\n // the e2e contract of the old card still holds\n cy.getByTestId(home.helpCard).contains('No Package Published Yet.');\n cy.getByTestId(home.helpCard).contains(`npm adduser --registry ${config.registryUrl}`);\n cy.getByTestId(home.helpCard).contains(`npm publish --registry ${config.registryUrl}`);\n\n cy.getByTestId(`${home.helpSetupTabPrefix}npm`).should('be.visible');\n cy.getByTestId(home.helpCard).contains(`npm config set registry ${config.registryUrl}`);\n // quoted: getByTestId does not escape the dot in `.npmrc`\n cy.get(`[data-testid=\"${home.helpSetupTabPrefix}.npmrc\"]`).click();\n cy.getByTestId(home.helpCard).contains(`registry=${config.registryUrl}`);\n cy.getByTestId(home.helpUplinksNote).should('be.visible');\n }\n );\n });\n\n describe('with packages from two scopes', () => {\n const scopedPkg = '@verdaccio/ux-toolbar-fixture';\n const unscopedPkg = 'ux-toolbar-unscoped-fixture';\n const tempFolders: string[] = [];\n\n before(() => {\n if (!flags.homeToolbar) return;\n [scopedPkg, unscopedPkg].forEach((pkgName) => {\n cy.task('publishPackage', { pkgName, version: '1.0.0', unique: true }).then((r) => {\n if (r?.tempFolder) tempFolders.push(r.tempFolder);\n });\n });\n });\n\n after(() => {\n if (!flags.homeToolbar) return;\n [scopedPkg, unscopedPkg].forEach((pkgName) => cy.task('unpublishPackage', pkgName));\n cy.then(() => tempFolders.forEach((folder) => cy.task('cleanupPublished', folder)));\n });\n\n beforeEach(() => {\n cy.intercept('GET', '/-/verdaccio/data/packages').as('pkgs');\n });\n\n maybeIt(flags.homeToolbar)('should filter the list and keep the filter in ?q=', () => {\n cy.visit(config.registryUrl);\n cy.wait('@pkgs');\n cy.getByTestId(home.packageListToolbar, { timeout: 10000 }).should('be.visible');\n cy.getByTestId(pkg.title).should('have.length', 2);\n\n cy.getByTestId(home.packageListFilter).type('unscoped', { delay: 20 });\n cy.getByTestId(pkg.title).should('have.length', 1).and('contain', unscopedPkg);\n cy.location('search').should('eq', '?q=unscoped');\n\n // a reload keeps the filter: it lives in the address\n cy.reload();\n cy.getByTestId(home.packageListFilter, { timeout: 10000 }).should('have.value', 'unscoped');\n cy.getByTestId(pkg.title).should('have.length', 1);\n });\n\n maybeIt(flags.homeToolbar)('should restore the scope from ?scope=', () => {\n cy.visit(`${config.registryUrl}/?scope=@verdaccio`);\n cy.wait('@pkgs');\n cy.getByTestId(home.packageListScope, { timeout: 10000 }).should(\n 'have.value',\n '@verdaccio'\n );\n cy.getByTestId(pkg.title).should('have.length', 1).and('contain', scopedPkg);\n });\n\n maybeIt(flags.homeToolbar)(\n 'should say nothing matches instead of showing the onboarding card',\n () => {\n cy.visit(`${config.registryUrl}/?q=no-package-matches-this`);\n cy.wait('@pkgs');\n cy.getByTestId(home.packageListNoMatch, { timeout: 10000 }).should('be.visible');\n cy.getByTestId(home.helpCard).should('not.exist');\n }\n );\n });\n\n describe('with a published package', () => {\n const pkgName = '@verdaccio/ux-detail-fixture';\n const detailUrl = `${config.registryUrl}/-/web/detail/${pkgName}`;\n const needsPackage =\n flags.detailTabInUrl ||\n flags.installBunAndNpmrc ||\n flags.copyFeedback ||\n flags.searchGrouping ||\n flags.versionLink ||\n flags.settingsPublishTab;\n let tempFolder: string | null = null;\n let version = '1.0.0';\n\n before(() => {\n if (!needsPackage) return;\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 // `unique: true` makes the version 1.0.0-t<timestamp>\n version = result?.version ?? version;\n });\n });\n\n after(() => {\n if (!needsPackage) return;\n cy.task('unpublishPackage', { pkgName, tempFolder: tempFolder ?? undefined });\n cy.then(() => {\n if (tempFolder) cy.task('cleanupPublished', tempFolder);\n });\n });\n\n maybeIt(flags.settingsPublishTab)(\n 'should keep the publishing guide in the settings once packages exist',\n () => {\n cy.visit(config.registryUrl);\n cy.getByTestId(pkg.itemList, { timeout: 10000 }).should('exist');\n cy.getByTestId(header.settingsTooltip).click();\n cy.getByTestId(header.settingsPublishTab).click();\n cy.getByTestId(header.settingsPublishPanel).within(() => {\n cy.getByTestId(home.helpGuide).should('be.visible');\n // the dialog scrolls; at the default viewport the command sits below the fold\n cy.contains(`npm publish --registry ${config.registryUrl}`)\n .scrollIntoView()\n .should('be.visible');\n });\n }\n );\n\n maybeIt(flags.versionLink)('should open the version page from the home list', () => {\n cy.visit(config.registryUrl);\n cy.contains(`[data-testid=\"${pkg.itemList}\"]`, pkgName, { timeout: 10000 })\n .find(`[data-testid=\"${pkg.versionLink}\"]`)\n .click();\n // scoped names keep the literal slash in the path\n cy.location('pathname').should('eq', `/-/web/detail/${pkgName}/v/${version}`);\n cy.getByTestId(pkg.sidebar, { timeout: 10000 }).contains(version);\n });\n\n maybeIt(flags.detailTabInUrl)('should keep the selected tab in ?tab=', () => {\n cy.visit(detailUrl);\n cy.getByTestId(pkg.versionsTab, { timeout: 10000 }).click();\n cy.location('search').should('contain', 'tab=versions');\n cy.getByTestId(pkg.tagLatest).should('be.visible');\n\n cy.getByTestId(pkg.readmeTab).click();\n cy.location('search').should('not.contain', 'tab=');\n });\n\n maybeIt(flags.detailTabInUrl)('should open the tab a link points to', () => {\n cy.visit(`${detailUrl}?tab=dependencies`);\n cy.getByTestId(pkg.dependenciesTab, { timeout: 10000 }).should(\n 'have.attr',\n 'aria-selected',\n 'true'\n );\n cy.getByTestId(pkg.dependencies).contains('debug');\n });\n\n maybeIt(flags.installBunAndNpmrc)(\n 'should offer bun and the scoped .npmrc line in the install box',\n () => {\n cy.visit(detailUrl);\n cy.getByTestId(pkg.installBun, { timeout: 10000 }).contains(`bun add ${pkgName}`);\n cy.getByTestId(pkg.installNpmrc).contains(`@verdaccio:registry=${config.registryUrl}`);\n }\n );\n\n maybeIt(flags.copyFeedback)('should confirm a copy on the copy button', () => {\n cy.visit(detailUrl);\n cy.getByTestId(pkg.installNpmrcCopy, { timeout: 10000 }).click();\n cy.getByTestId(pkg.installNpmrcCopy).should('have.attr', 'aria-label', 'Copied');\n });\n\n maybeIt(flags.searchGrouping)(\n 'should list a package published here under its own search group',\n () => {\n cy.intercept('GET', '**/-/verdaccio/data/search/**').as('webSearch');\n cy.visit(config.registryUrl);\n cy.get('input[placeholder*=\"earch\"]', { timeout: 10000 }).type('ux-detail-fixture', {\n delay: 30,\n });\n cy.wait('@webSearch', { timeout: 10000 });\n cy.get('[role=\"listbox\"]', { timeout: 5000 }).within(() => {\n cy.getByTestId(`${search.groupPrefix}private`).should('be.visible');\n cy.contains('[role=\"option\"]', pkgName)\n .find(`[data-testid=\"${search.originPrefix}private\"]`)\n .should('exist');\n });\n }\n );\n });\n });\n}\n"],"mappings":";;;;;;;;;;AAYA,SAAgB,kBAAkB,QAAwB;CACxD,MAAM,EAAE,aAAa;CACrB,MAAM,QAAQ,SAAS;CACvB,MAAM,EAAE,QAAQ,MAAM,SAAS,KAAK,WAAW,OAAO;CAEtD,SAAS,4BAA4B;EACnC,SAAS,gCAAgC;GACvC,iBAAiB;IACf,GAAG,UAAU,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GAAG,YAAY,IAAI,YAAY,CAAC,CAAC,SAAS,uBAAuB,OAAO,aAAa;GACvF,CACF;GAEA,iBAAA,QAAQ,MAAM,YAAY,CAAC,CAAC,kDAAkD;IAC5E,GAAG,MAAM,SAAS;IAClB,GAAG,YAAY,IAAI,kBAAkB,EAAE,SAAS,IAAM,CAAC,CAAC,CAAC,MAAM;IAC/D,GAAG,YAAY,IAAI,gBAAgB,CAAC,CAAC,OAAO,aAAa,cAAc,QAAQ;GACjF,CAAC;GAED,iBAAA,QAAQ,MAAM,cAAc,CAAC,CAC3B,yEACM;IACJ,GAAG,UAAU,OAAO,+BAA+B,CAAC,CAAC,GAAG,WAAW;IACnE,GAAG,MAAM,OAAO,WAAW;IAC3B,GAAG,IAAI,iCAA+B,EAAE,SAAS,IAAM,CAAC,CAAC,CAAC,KAAK,qBAAqB,EAClF,OAAO,GACT,CAAC;IACD,GAAG,KAAK,cAAc,EAAE,SAAS,IAAM,CAAC;IACxC,GAAG,IAAI,sBAAoB,EAAE,SAAS,IAAK,CAAC,CAAC,CAAC,aAAa;KACzD,GAAG,YAAY,GAAG,OAAO,YAAY,QAAQ,CAAC,CAAC,OAAO,YAAY;KAClE,GAAG,SAAS,qBAAmB,OAAO,CAAC,CACpC,KAAK,iBAAiB,OAAO,aAAa,UAAU,CAAC,CACrD,OAAO,OAAO;IACnB,CAAC;GACH,CACF;EACF,CAAC;CACH,CAAC;AACH"}
|
|
@@ -11,13 +11,17 @@ const require_i18n_keys = require("./i18n-keys.cjs");
|
|
|
11
11
|
const require_signup = require("./signup.cjs");
|
|
12
12
|
const require_manifest_rendering = require("./manifest-rendering.cjs");
|
|
13
13
|
const require_session = require("./session.cjs");
|
|
14
|
+
const require_home_detail_ux = require("./home-detail-ux.cjs");
|
|
15
|
+
const require_provenance = require("./provenance.cjs");
|
|
14
16
|
exports.changePasswordTests = require_change_password.changePasswordTests;
|
|
15
17
|
exports.detailTests = require_detail.detailTests;
|
|
16
18
|
exports.failureModeTests = require_failure_modes.failureModeTests;
|
|
19
|
+
exports.homeDetailUxTests = require_home_detail_ux.homeDetailUxTests;
|
|
17
20
|
exports.homeTests = require_home.homeTests;
|
|
18
21
|
exports.i18nKeyTests = require_i18n_keys.i18nKeyTests;
|
|
19
22
|
exports.layoutTests = require_layout.layoutTests;
|
|
20
23
|
exports.manifestRenderingTests = require_manifest_rendering.manifestRenderingTests;
|
|
24
|
+
exports.provenanceTests = require_provenance.provenanceTests;
|
|
21
25
|
exports.publishTests = require_publish.publishTests;
|
|
22
26
|
exports.searchTests = require_search.searchTests;
|
|
23
27
|
exports.sessionTests = require_session.sessionTests;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
const require_features = require("../features.cjs");
|
|
2
|
+
//#region src/tests/provenance.ts
|
|
3
|
+
/**
|
|
4
|
+
* "Provenance" sidebar section (9.x, verdaccio/verdaccio#6447).
|
|
5
|
+
*
|
|
6
|
+
* registry.npmjs.org attaches `dist.signatures` and `dist.attestations` to
|
|
7
|
+
* every version it signs; the UI shows them without verifying anything in
|
|
8
|
+
* the browser. The fixtures below publish those fields themselves (npm keeps
|
|
9
|
+
* extra `dist` fields on publish), so the suite runs offline and does not
|
|
10
|
+
* need an uplink. The build details come from the registry only when it
|
|
11
|
+
* announces the endpoint, so against this fixture the dialog ends at the
|
|
12
|
+
* summary.
|
|
13
|
+
*/
|
|
14
|
+
function provenanceTests(config) {
|
|
15
|
+
const { features } = config;
|
|
16
|
+
const { package: pkg } = config.testIds;
|
|
17
|
+
const attestations = {
|
|
18
|
+
url: "https://registry.npmjs.org/-/npm/v1/attestations/e2e-provenance@1.0.0",
|
|
19
|
+
provenance: { predicateType: "https://slsa.dev/provenance/v1" }
|
|
20
|
+
};
|
|
21
|
+
const signatures = [{
|
|
22
|
+
keyid: "SHA256:e2e-fixture-key",
|
|
23
|
+
sig: "MEUCIQDe2e"
|
|
24
|
+
}];
|
|
25
|
+
describe("provenance", () => {
|
|
26
|
+
describe("with provenance metadata", () => {
|
|
27
|
+
const pkgName = "@verdaccio/provenance-fixture";
|
|
28
|
+
let tempFolder = null;
|
|
29
|
+
beforeEach(() => {
|
|
30
|
+
cy.task("publishPackage", {
|
|
31
|
+
pkgName,
|
|
32
|
+
version: "1.0.0",
|
|
33
|
+
unique: true,
|
|
34
|
+
manifest: { dist: {
|
|
35
|
+
signatures,
|
|
36
|
+
attestations
|
|
37
|
+
} }
|
|
38
|
+
}).then((result) => {
|
|
39
|
+
tempFolder = result?.tempFolder ?? null;
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
afterEach(() => {
|
|
43
|
+
cy.task("unpublishPackage", {
|
|
44
|
+
pkgName,
|
|
45
|
+
tempFolder: tempFolder ?? void 0
|
|
46
|
+
});
|
|
47
|
+
if (tempFolder) cy.task("cleanupPublished", tempFolder);
|
|
48
|
+
tempFolder = null;
|
|
49
|
+
});
|
|
50
|
+
require_features.maybeIt(features.provenance.sidebarSection)("should show the provenance chip and open the dialog with the summary", () => {
|
|
51
|
+
cy.intercept("GET", `/-/verdaccio/data/sidebar/${pkgName}*`).as("sidebar");
|
|
52
|
+
cy.intercept("GET", `/-/verdaccio/data/package/provenance/${pkgName}*`).as("details");
|
|
53
|
+
cy.visit(`${config.registryUrl}/-/web/detail/${pkgName}`);
|
|
54
|
+
cy.wait("@sidebar", { timeout: 1e4 });
|
|
55
|
+
cy.getByTestId(pkg.provenanceBadge).scrollIntoView().should("be.visible").and("contain.text", "Provenance").and("contain.text", "SLSA v1");
|
|
56
|
+
cy.getByTestId(pkg.provenanceBadge).click();
|
|
57
|
+
cy.getByTestId(pkg.provenanceDialog).should("be.visible");
|
|
58
|
+
cy.getByTestId(pkg.provenanceDialog).within(() => {
|
|
59
|
+
cy.contains(`${pkgName}@`);
|
|
60
|
+
cy.contains("SLSA v1");
|
|
61
|
+
cy.contains(signatures[0].keyid);
|
|
62
|
+
cy.contains("registry.npmjs.org/-/npm/v1/attestations/e2e-provenance@1.0.0").should("have.attr", "href", attestations.url);
|
|
63
|
+
cy.contains("cryptographic verification has not been performed");
|
|
64
|
+
});
|
|
65
|
+
cy.wait("@details", { timeout: 1e4 }).then((interception) => {
|
|
66
|
+
expect(interception.response?.statusCode).to.equal(404);
|
|
67
|
+
});
|
|
68
|
+
cy.getByTestId(pkg.provenanceDialog).should("not.contain.text", "Built on");
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
describe("with a registry signature only", () => {
|
|
72
|
+
const pkgName = "@verdaccio/signature-fixture";
|
|
73
|
+
let tempFolder = null;
|
|
74
|
+
beforeEach(() => {
|
|
75
|
+
cy.task("publishPackage", {
|
|
76
|
+
pkgName,
|
|
77
|
+
version: "1.0.0",
|
|
78
|
+
unique: true,
|
|
79
|
+
manifest: { dist: { signatures } }
|
|
80
|
+
}).then((result) => {
|
|
81
|
+
tempFolder = result?.tempFolder ?? null;
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
afterEach(() => {
|
|
85
|
+
cy.task("unpublishPackage", {
|
|
86
|
+
pkgName,
|
|
87
|
+
tempFolder: tempFolder ?? void 0
|
|
88
|
+
});
|
|
89
|
+
if (tempFolder) cy.task("cleanupPublished", tempFolder);
|
|
90
|
+
tempFolder = null;
|
|
91
|
+
});
|
|
92
|
+
require_features.maybeIt(features.provenance.sidebarSection)("should show the registry signature chip without requesting build details", () => {
|
|
93
|
+
cy.intercept("GET", `/-/verdaccio/data/package/provenance/${pkgName}*`).as("details");
|
|
94
|
+
cy.visit(`${config.registryUrl}/-/web/detail/${pkgName}`);
|
|
95
|
+
cy.getByTestId(pkg.provenanceBadge).scrollIntoView().should("be.visible").and("contain.text", "Registry signature");
|
|
96
|
+
cy.getByTestId(pkg.provenanceBadge).click();
|
|
97
|
+
cy.getByTestId(pkg.provenanceDialog).within(() => {
|
|
98
|
+
cy.contains(signatures[0].keyid);
|
|
99
|
+
});
|
|
100
|
+
cy.get("@details.all").should("have.length", 0);
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
describe("without provenance metadata", () => {
|
|
104
|
+
const pkgName = "@verdaccio/plain-fixture";
|
|
105
|
+
let tempFolder = null;
|
|
106
|
+
beforeEach(() => {
|
|
107
|
+
cy.task("publishPackage", {
|
|
108
|
+
pkgName,
|
|
109
|
+
version: "1.0.0",
|
|
110
|
+
unique: true
|
|
111
|
+
}).then((result) => {
|
|
112
|
+
tempFolder = result?.tempFolder ?? null;
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
afterEach(() => {
|
|
116
|
+
cy.task("unpublishPackage", {
|
|
117
|
+
pkgName,
|
|
118
|
+
tempFolder: tempFolder ?? void 0
|
|
119
|
+
});
|
|
120
|
+
if (tempFolder) cy.task("cleanupPublished", tempFolder);
|
|
121
|
+
tempFolder = null;
|
|
122
|
+
});
|
|
123
|
+
require_features.maybeIt(features.provenance.sidebarSection)("should not render the section", () => {
|
|
124
|
+
cy.visit(`${config.registryUrl}/-/web/detail/${pkgName}`);
|
|
125
|
+
cy.getByTestId(pkg.sidebar).should("be.visible");
|
|
126
|
+
cy.getByTestId(pkg.provenanceBadge).should("not.exist");
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
//#endregion
|
|
132
|
+
exports.provenanceTests = provenanceTests;
|
|
133
|
+
|
|
134
|
+
//# sourceMappingURL=provenance.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provenance.cjs","names":[],"sources":["../../../src/tests/provenance.ts"],"sourcesContent":["/// <reference types=\"cypress\" />\nimport { maybeIt } from '../features';\nimport { RegistryConfig } from '../types';\n\n/**\n * \"Provenance\" sidebar section (9.x, verdaccio/verdaccio#6447).\n *\n * registry.npmjs.org attaches `dist.signatures` and `dist.attestations` to\n * every version it signs; the UI shows them without verifying anything in\n * the browser. The fixtures below publish those fields themselves (npm keeps\n * extra `dist` fields on publish), so the suite runs offline and does not\n * need an uplink. The build details come from the registry only when it\n * announces the endpoint, so against this fixture the dialog ends at the\n * summary.\n */\nexport function provenanceTests(config: RegistryConfig) {\n const { features } = config;\n const { package: pkg } = config.testIds;\n\n const attestations = {\n url: 'https://registry.npmjs.org/-/npm/v1/attestations/e2e-provenance@1.0.0',\n provenance: { predicateType: 'https://slsa.dev/provenance/v1' },\n };\n const signatures = [{ keyid: 'SHA256:e2e-fixture-key', sig: 'MEUCIQDe2e' }];\n\n describe('provenance', () => {\n describe('with provenance metadata', () => {\n const pkgName = '@verdaccio/provenance-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 manifest: { dist: { signatures, attestations } },\n }).then((result) => {\n tempFolder = result?.tempFolder ?? null;\n });\n });\n\n afterEach(() => {\n cy.task('unpublishPackage', { pkgName, tempFolder: tempFolder ?? undefined });\n if (tempFolder) {\n cy.task('cleanupPublished', tempFolder);\n }\n tempFolder = null;\n });\n\n maybeIt(features.provenance.sidebarSection)(\n 'should show the provenance chip and open the dialog with the summary',\n () => {\n cy.intercept('GET', `/-/verdaccio/data/sidebar/${pkgName}*`).as('sidebar');\n cy.intercept('GET', `/-/verdaccio/data/package/provenance/${pkgName}*`).as('details');\n\n cy.visit(`${config.registryUrl}/-/web/detail/${pkgName}`);\n cy.wait('@sidebar', { timeout: 10000 });\n\n // the sidebar scrolls on its own; bring the chip into its viewport first\n cy.getByTestId(pkg.provenanceBadge)\n .scrollIntoView()\n .should('be.visible')\n .and('contain.text', 'Provenance')\n .and('contain.text', 'SLSA v1');\n\n cy.getByTestId(pkg.provenanceBadge).click();\n cy.getByTestId(pkg.provenanceDialog).should('be.visible');\n cy.getByTestId(pkg.provenanceDialog).within(() => {\n cy.contains(`${pkgName}@`);\n cy.contains('SLSA v1');\n cy.contains(signatures[0].keyid);\n cy.contains('registry.npmjs.org/-/npm/v1/attestations/e2e-provenance@1.0.0').should(\n 'have.attr',\n 'href',\n attestations.url\n );\n cy.contains('cryptographic verification has not been performed');\n });\n\n // the build details are asked for only once the dialog is open; this\n // fixture has no uplink holding the bundle, so the registry answers 404\n // and the dialog keeps the summary\n cy.wait('@details', { timeout: 10000 }).then((interception: any) => {\n expect(interception.response?.statusCode).to.equal(404);\n });\n cy.getByTestId(pkg.provenanceDialog).should('not.contain.text', 'Built on');\n }\n );\n });\n\n describe('with a registry signature only', () => {\n const pkgName = '@verdaccio/signature-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 manifest: { dist: { signatures } },\n }).then((result) => {\n tempFolder = result?.tempFolder ?? null;\n });\n });\n\n afterEach(() => {\n cy.task('unpublishPackage', { pkgName, tempFolder: tempFolder ?? undefined });\n if (tempFolder) {\n cy.task('cleanupPublished', tempFolder);\n }\n tempFolder = null;\n });\n\n maybeIt(features.provenance.sidebarSection)(\n 'should show the registry signature chip without requesting build details',\n () => {\n cy.intercept('GET', `/-/verdaccio/data/package/provenance/${pkgName}*`).as('details');\n\n cy.visit(`${config.registryUrl}/-/web/detail/${pkgName}`);\n\n cy.getByTestId(pkg.provenanceBadge)\n .scrollIntoView()\n .should('be.visible')\n .and('contain.text', 'Registry signature');\n cy.getByTestId(pkg.provenanceBadge).click();\n cy.getByTestId(pkg.provenanceDialog).within(() => {\n cy.contains(signatures[0].keyid);\n });\n // no attestation, so the dialog never asks the registry for build details\n cy.get('@details.all').should('have.length', 0);\n }\n );\n });\n\n describe('without provenance metadata', () => {\n const pkgName = '@verdaccio/plain-fixture';\n let tempFolder: string | null = null;\n\n beforeEach(() => {\n cy.task('publishPackage', { pkgName, version: '1.0.0', unique: true }).then((result) => {\n tempFolder = result?.tempFolder ?? null;\n });\n });\n\n afterEach(() => {\n cy.task('unpublishPackage', { pkgName, tempFolder: tempFolder ?? undefined });\n if (tempFolder) {\n cy.task('cleanupPublished', tempFolder);\n }\n tempFolder = null;\n });\n\n maybeIt(features.provenance.sidebarSection)('should not render the section', () => {\n cy.visit(`${config.registryUrl}/-/web/detail/${pkgName}`);\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,oBAAoB;IAC3C,GAAG,YAAY,IAAI,eAAe,CAAC,CAAC,MAAM;IAC1C,GAAG,YAAY,IAAI,gBAAgB,CAAC,CAAC,aAAa;KAChD,GAAG,SAAS,WAAW,EAAE,CAAC,KAAK;IACjC,CAAC;IAED,GAAG,IAAI,cAAc,CAAC,CAAC,OAAO,eAAe,CAAC;GAChD,CACF;EACF,CAAC;EAED,SAAS,qCAAqC;GAC5C,MAAM,UAAU;GAChB,IAAI,aAA4B;GAEhC,iBAAiB;IACf,GAAG,KAAK,kBAAkB;KAAE;KAAS,SAAS;KAAS,QAAQ;IAAK,CAAC,CAAC,CAAC,MAAM,WAAW;KACtF,aAAa,QAAQ,cAAc;IACrC,CAAC;GACH,CAAC;GAED,gBAAgB;IACd,GAAG,KAAK,oBAAoB;KAAE;KAAS,YAAY,cAAc,KAAA;IAAU,CAAC;IAC5E,IAAI,YACF,GAAG,KAAK,oBAAoB,UAAU;IAExC,aAAa;GACf,CAAC;GAED,iBAAA,QAAQ,SAAS,WAAW,cAAc,CAAC,CAAC,uCAAuC;IACjF,GAAG,MAAM,GAAG,OAAO,YAAY,gBAAgB,SAAS;IACxD,GAAG,YAAY,IAAI,OAAO,CAAC,CAAC,OAAO,YAAY;IAC/C,GAAG,YAAY,IAAI,eAAe,CAAC,CAAC,OAAO,WAAW;GACxD,CAAC;EACH,CAAC;CACH,CAAC;AACH"}
|
|
@@ -91,7 +91,7 @@ function publishTests(config) {
|
|
|
91
91
|
cy.wait("@pkgs");
|
|
92
92
|
cy.getByTestId(pkg.title).first().click();
|
|
93
93
|
cy.wait("@sidebar");
|
|
94
|
-
cy.getByTestId(pkg.keywordList).should("be.visible");
|
|
94
|
+
cy.getByTestId(pkg.keywordList).scrollIntoView().should("be.visible");
|
|
95
95
|
cy.getByTestId(pkg.keywordList).should("contain.text", "verdaccio");
|
|
96
96
|
cy.getByTestId(pkg.keywordList).should("contain.text", "e2e");
|
|
97
97
|
cy.getByTestId(pkg.keywordList).should("contain.text", "test");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.cjs","names":[],"sources":["../../../src/tests/publish.ts"],"sourcesContent":["/// <reference types=\"cypress\" />\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 * Log in once, reuse the session across tests in the requested 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 = (sessionName: string) => {\n cy.session(\n [sessionName, 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 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 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('publish-suite');\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).should('be.visible').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 }).its('response.statusCode').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('be.visible');\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.closeRawViewer).click();\n cy.getByTestId(pkg.rawViewerDialog).should('not.exist');\n }\n );\n });\n\n describe('private package tarball downloads', () => {\n const privatePkgName = '@private/tarball-fixture';\n let tempFolder: string | null = null;\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/@private/tarball-fixture*').as('sidebar');\n\n cy.task('publishPackage', {\n pkgName: privatePkgName,\n version: '1.0.0',\n unique: true,\n }).then((result) => {\n tempFolder = result?.tempFolder ?? null;\n });\n\n loginOnce('private-tarball-suite');\n cy.visit(config.registryUrl);\n });\n\n afterEach(() => {\n cy.task('unpublishPackage', {\n pkgName: privatePkgName,\n tempFolder: tempFolder ?? undefined,\n });\n if (tempFolder) {\n cy.task('cleanupPublished', tempFolder);\n }\n tempFolder = null;\n });\n\n maybeIt(features.publish.privateDownloadTarball)(\n 'should fetch a private tarball from the home package list',\n () => {\n cy.intercept('GET', '**/tarball-fixture-*.tgz').as('privateTarballFetch');\n\n cy.wait('@pkgs');\n cy.contains(`[data-testid=\"${pkg.title}\"]`, privatePkgName)\n .should('be.visible')\n .closest(`[data-testid=\"${pkg.itemList}\"]`)\n .find(`[data-testid=\"${pkg.downloadTarball}\"]`)\n .should('be.visible')\n .click();\n\n cy.wait('@privateTarballFetch', { timeout: 10000 })\n .its('response.statusCode')\n .should('eq', 200);\n }\n );\n\n maybeIt(features.publish.privateDownloadTarball)(\n 'should fetch a private tarball from the package sidebar',\n () => {\n cy.intercept('GET', '**/tarball-fixture-*.tgz').as('privateTarballFetch');\n\n cy.wait('@pkgs');\n cy.contains(`[data-testid=\"${pkg.title}\"]`, privatePkgName).click();\n cy.wait('@sidebar');\n cy.getByTestId(pkg.downloadTarballBtn).should('be.visible').click();\n\n cy.wait('@privateTarballFetch', { timeout: 10000 })\n .its('response.statusCode')\n .should('eq', 200);\n }\n );\n });\n}\n"],"mappings":";;AAIA,SAAgB,aAAa,QAAwB;CACnD,MAAM,EAAE,QAAQ,SAAS,QAAQ,OAAO;CACxC,MAAM,EAAE,cAAc,gBAAgB,OAAO;CAC7C,MAAM,EAAE,aAAa;;;;;;CAMrB,MAAM,aAAa,gBAAwB;EACzC,GAAG,QACD,CAAC,aAAa,OAAO,YAAY,IAAI,SAC/B;GACJ,GAAG,MAAM,OAAO,WAAW;GAC3B,GAAG,MAAM,OAAO,YAAY,MAAM,OAAO,YAAY,UA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|
+
{"version":3,"file":"publish.cjs","names":[],"sources":["../../../src/tests/publish.ts"],"sourcesContent":["/// <reference types=\"cypress\" />\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 * Log in once, reuse the session across tests in the requested 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 = (sessionName: string) => {\n cy.session(\n [sessionName, 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 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 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('publish-suite');\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 // the sidebar scrolls; a taller install box can push the keywords below the fold\n cy.getByTestId(pkg.keywordList).scrollIntoView().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).should('be.visible').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 }).its('response.statusCode').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('be.visible');\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.closeRawViewer).click();\n cy.getByTestId(pkg.rawViewerDialog).should('not.exist');\n }\n );\n });\n\n describe('private package tarball downloads', () => {\n const privatePkgName = '@private/tarball-fixture';\n let tempFolder: string | null = null;\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/@private/tarball-fixture*').as('sidebar');\n\n cy.task('publishPackage', {\n pkgName: privatePkgName,\n version: '1.0.0',\n unique: true,\n }).then((result) => {\n tempFolder = result?.tempFolder ?? null;\n });\n\n loginOnce('private-tarball-suite');\n cy.visit(config.registryUrl);\n });\n\n afterEach(() => {\n cy.task('unpublishPackage', {\n pkgName: privatePkgName,\n tempFolder: tempFolder ?? undefined,\n });\n if (tempFolder) {\n cy.task('cleanupPublished', tempFolder);\n }\n tempFolder = null;\n });\n\n maybeIt(features.publish.privateDownloadTarball)(\n 'should fetch a private tarball from the home package list',\n () => {\n cy.intercept('GET', '**/tarball-fixture-*.tgz').as('privateTarballFetch');\n\n cy.wait('@pkgs');\n cy.contains(`[data-testid=\"${pkg.title}\"]`, privatePkgName)\n .should('be.visible')\n .closest(`[data-testid=\"${pkg.itemList}\"]`)\n .find(`[data-testid=\"${pkg.downloadTarball}\"]`)\n .should('be.visible')\n .click();\n\n cy.wait('@privateTarballFetch', { timeout: 10000 })\n .its('response.statusCode')\n .should('eq', 200);\n }\n );\n\n maybeIt(features.publish.privateDownloadTarball)(\n 'should fetch a private tarball from the package sidebar',\n () => {\n cy.intercept('GET', '**/tarball-fixture-*.tgz').as('privateTarballFetch');\n\n cy.wait('@pkgs');\n cy.contains(`[data-testid=\"${pkg.title}\"]`, privatePkgName).click();\n cy.wait('@sidebar');\n cy.getByTestId(pkg.downloadTarballBtn).should('be.visible').click();\n\n cy.wait('@privateTarballFetch', { timeout: 10000 })\n .its('response.statusCode')\n .should('eq', 200);\n }\n );\n });\n}\n"],"mappings":";;AAIA,SAAgB,aAAa,QAAwB;CACnD,MAAM,EAAE,QAAQ,SAAS,QAAQ,OAAO;CACxC,MAAM,EAAE,cAAc,gBAAgB,OAAO;CAC7C,MAAM,EAAE,aAAa;;;;;;CAMrB,MAAM,aAAa,gBAAwB;EACzC,GAAG,QACD,CAAC,aAAa,OAAO,YAAY,IAAI,SAC/B;GACJ,GAAG,MAAM,OAAO,WAAW;GAC3B,GAAG,MAAM,OAAO,YAAY,MAAM,OA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CACF;CACF,CAAC;AACH"}
|
|
@@ -33,7 +33,7 @@ function settingsTests(config) {
|
|
|
33
33
|
it("should show both Package Managers and Translations tabs", () => {
|
|
34
34
|
cy.getByTestId(header.settingsTooltip).click();
|
|
35
35
|
cy.get("[role=\"dialog\"]").should("be.visible");
|
|
36
|
-
cy.get("[role=\"dialog\"] [role=\"tab\"]").should("have.length", 2);
|
|
36
|
+
cy.get("[role=\"dialog\"] [role=\"tab\"]").should("have.length.at.least", 2);
|
|
37
37
|
cy.contains("[role=\"dialog\"] [role=\"tab\"]", "Translations").should("be.visible");
|
|
38
38
|
});
|
|
39
39
|
it("should switch to the Translations tab and list languages", () => {
|
|
@@ -49,7 +49,10 @@ function settingsTests(config) {
|
|
|
49
49
|
cy.get("[role=\"dialog\"]").should("be.visible");
|
|
50
50
|
cy.contains("[role=\"dialog\"] [role=\"tab\"]", "Translations").click();
|
|
51
51
|
cy.contains("[role=\"dialog\"]", "Configuration").invoke("text").then((englishTitle) => {
|
|
52
|
-
cy.contains("[role=\"dialog\"] .MuiCard-root", "German").
|
|
52
|
+
cy.contains("[role=\"dialog\"] .MuiCard-root", "German").then(($card) => {
|
|
53
|
+
const $area = $card.find(".MuiCardActionArea-root");
|
|
54
|
+
cy.wrap($area.length ? $area : $card).click({ force: true });
|
|
55
|
+
});
|
|
53
56
|
cy.contains("[role=\"dialog\"] [role=\"tab\"]", "Translations").should("not.exist");
|
|
54
57
|
cy.contains("[role=\"dialog\"]", englishTitle).should("not.exist");
|
|
55
58
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.cjs","names":[],"sources":["../../../src/tests/settings.ts"],"sourcesContent":["/// <reference types=\"cypress\" />\nimport { maybeIt } from '../features';\nimport { RegistryConfig } from '../types';\n\n/**\n * Tests for the header Settings dialog and the Translations (language)\n * picker inside it.\n *\n * Requires `web.showSettings: true` in the registry config — the gear\n * icon only renders when the flag is on (see HeaderRight in Verdaccio's\n * ui-components package).\n *\n * Selector strategy: the language cards in LanguageSwitch do NOT have\n * data-testids, so this suite leans on:\n * - MUI's ARIA roles: `[role=\"dialog\"]`, `[role=\"tab\"]`\n * - The stable English labels \"Configuration\", \"Translations\",\n * \"English\", \"German\", and the language description text, which are\n * bundled into the ui-theme via `@verdaccio/ui-i18n`\n * - The settings trigger's testid from Verdaccio's HeaderToolTipIcon:\n * `header--tooltip-settings`\n */\nexport function settingsTests(config: RegistryConfig) {\n const { header } = config.testIds;\n const { features } = config;\n\n describe('settings & language', () => {\n beforeEach(() => {\n cy.visit(config.registryUrl);\n cy.get('body').should('be.visible');\n });\n\n it('should open the settings dialog from the header', () => {\n cy.getByTestId(header.settingsTooltip).click();\n cy.get('[role=\"dialog\"]').should('be.visible');\n // Dialog title key: dialog.settings.title → \"Configuration\" in EN.\n cy.contains('[role=\"dialog\"]', 'Configuration').should('be.visible');\n });\n\n it('should show both Package Managers and Translations tabs', () => {\n cy.getByTestId(header.settingsTooltip).click();\n cy.get('[role=\"dialog\"]').should('be.visible');\n cy.get('[role=\"dialog\"] [role=\"tab\"]').should('have.length', 2);\n cy.contains('[role=\"dialog\"] [role=\"tab\"]', 'Translations').should('be.visible');\n });\n\n it('should switch to the Translations tab and list languages', () => {\n cy.getByTestId(header.settingsTooltip).click();\n cy.get('[role=\"dialog\"]').should('be.visible');\n cy.contains('[role=\"dialog\"] [role=\"tab\"]', 'Translations').click();\n // language.description text is bundled in EN — good sentinel.\n cy.contains('[role=\"dialog\"]', /this is the configuration details for the language/i).should(\n 'be.visible'\n );\n // Sanity-check a couple of language cards are rendered.\n cy.contains('[role=\"dialog\"]', 'English').should('be.visible');\n cy.contains('[role=\"dialog\"]', 'German').should('be.visible');\n });\n\n maybeIt(features.settings.languageSwitcher)(\n 'should change the UI language when a language card is clicked',\n () => {\n cy.getByTestId(header.settingsTooltip).click();\n cy.get('[role=\"dialog\"]').should('be.visible');\n cy.contains('[role=\"dialog\"] [role=\"tab\"]', 'Translations').click();\n\n // Before switching, capture the current dialog title so we can\n // assert it changes. This avoids hard-coding the German string.\n cy.contains('[role=\"dialog\"]', 'Configuration')\n .invoke('text')\n .then((englishTitle) => {\n // Click the German card. We scope to the dialog + the MUI\n // card class to avoid matching other \"German\" text.\n cy.contains('[role=\"dialog\"] .MuiCard-root', 'German').
|
|
1
|
+
{"version":3,"file":"settings.cjs","names":[],"sources":["../../../src/tests/settings.ts"],"sourcesContent":["/// <reference types=\"cypress\" />\nimport { maybeIt } from '../features';\nimport { RegistryConfig } from '../types';\n\n/**\n * Tests for the header Settings dialog and the Translations (language)\n * picker inside it.\n *\n * Requires `web.showSettings: true` in the registry config — the gear\n * icon only renders when the flag is on (see HeaderRight in Verdaccio's\n * ui-components package).\n *\n * Selector strategy: the language cards in LanguageSwitch do NOT have\n * data-testids, so this suite leans on:\n * - MUI's ARIA roles: `[role=\"dialog\"]`, `[role=\"tab\"]`\n * - The stable English labels \"Configuration\", \"Translations\",\n * \"English\", \"German\", and the language description text, which are\n * bundled into the ui-theme via `@verdaccio/ui-i18n`\n * - The settings trigger's testid from Verdaccio's HeaderToolTipIcon:\n * `header--tooltip-settings`\n */\nexport function settingsTests(config: RegistryConfig) {\n const { header } = config.testIds;\n const { features } = config;\n\n describe('settings & language', () => {\n beforeEach(() => {\n cy.visit(config.registryUrl);\n cy.get('body').should('be.visible');\n });\n\n it('should open the settings dialog from the header', () => {\n cy.getByTestId(header.settingsTooltip).click();\n cy.get('[role=\"dialog\"]').should('be.visible');\n // Dialog title key: dialog.settings.title → \"Configuration\" in EN.\n cy.contains('[role=\"dialog\"]', 'Configuration').should('be.visible');\n });\n\n it('should show both Package Managers and Translations tabs', () => {\n cy.getByTestId(header.settingsTooltip).click();\n cy.get('[role=\"dialog\"]').should('be.visible');\n // 9.x adds a \"Publishing\" tab, so count the two this test is about as a minimum\n cy.get('[role=\"dialog\"] [role=\"tab\"]').should('have.length.at.least', 2);\n cy.contains('[role=\"dialog\"] [role=\"tab\"]', 'Translations').should('be.visible');\n });\n\n it('should switch to the Translations tab and list languages', () => {\n cy.getByTestId(header.settingsTooltip).click();\n cy.get('[role=\"dialog\"]').should('be.visible');\n cy.contains('[role=\"dialog\"] [role=\"tab\"]', 'Translations').click();\n // language.description text is bundled in EN — good sentinel.\n cy.contains('[role=\"dialog\"]', /this is the configuration details for the language/i).should(\n 'be.visible'\n );\n // Sanity-check a couple of language cards are rendered.\n cy.contains('[role=\"dialog\"]', 'English').should('be.visible');\n cy.contains('[role=\"dialog\"]', 'German').should('be.visible');\n });\n\n maybeIt(features.settings.languageSwitcher)(\n 'should change the UI language when a language card is clicked',\n () => {\n cy.getByTestId(header.settingsTooltip).click();\n cy.get('[role=\"dialog\"]').should('be.visible');\n cy.contains('[role=\"dialog\"] [role=\"tab\"]', 'Translations').click();\n\n // Before switching, capture the current dialog title so we can\n // assert it changes. This avoids hard-coding the German string.\n cy.contains('[role=\"dialog\"]', 'Configuration')\n .invoke('text')\n .then((englishTitle) => {\n // Click the German card. We scope to the dialog + the MUI\n // card class to avoid matching other \"German\" text.\n // released UIs handle the click on the card, 9.x on its CardActionArea\n cy.contains('[role=\"dialog\"] .MuiCard-root', 'German').then(($card) => {\n const $area = $card.find('.MuiCardActionArea-root');\n cy.wrap($area.length ? $area : $card).click({ force: true });\n });\n\n // The English tab label \"Translations\" must no longer be\n // present anywhere in the dialog — strongest proof the\n // language actually switched.\n cy.contains('[role=\"dialog\"] [role=\"tab\"]', 'Translations').should('not.exist');\n // And the original dialog title text should also be gone.\n cy.contains('[role=\"dialog\"]', englishTitle).should('not.exist');\n });\n }\n );\n\n it('should close the settings dialog with Escape', () => {\n cy.getByTestId(header.settingsTooltip).click();\n cy.get('[role=\"dialog\"]').should('be.visible');\n cy.get('body').type('{esc}');\n cy.get('[role=\"dialog\"]').should('not.exist');\n });\n\n maybeIt(features.settings.localizedDates)(\n 'relative dates must follow the selected language (dayjs locale)',\n () => {\n // fresh fixture so \"published … ago\" is a relative date\n const pkgName = '@verdaccio/dates-fixture';\n let tempFolder: string | null = null;\n cy.task('publishPackage', { pkgName, version: '1.0.0', unique: true }).then((result) => {\n tempFolder = result?.tempFolder ?? null;\n });\n\n // switch the UI to German via the settings dialog\n cy.getByTestId(header.settingsTooltip).click();\n cy.get('[role=\"dialog\"]').should('be.visible');\n cy.contains('[role=\"dialog\"] [role=\"tab\"]', 'Translations').click();\n cy.contains('[role=\"dialog\"] .MuiCard-root', 'German').click({ force: true });\n cy.get('body').type('{esc}');\n\n // the language persists; a fresh page load must localize dayjs too\n const sidebar = `[data-testid=\"${config.testIds.package.sidebar}\"]`;\n cy.visit(`${config.registryUrl}/-/web/detail/${pkgName}`);\n cy.get(sidebar, { timeout: 10000 }).should('be.visible');\n // dayjs de locale renders relative times as \"vor ein paar Sekunden\";\n // the released UIs kept English (\"a few seconds ago\") in every language\n cy.get(sidebar).contains(/vor /);\n cy.get(sidebar).contains(/ago\\b/).should('not.exist');\n\n cy.task('unpublishPackage', { pkgName, tempFolder: tempFolder ?? undefined });\n cy.then(() => {\n if (tempFolder) cy.task('cleanupPublished', tempFolder);\n });\n }\n );\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAqBA,SAAgB,cAAc,QAAwB;CACpD,MAAM,EAAE,WAAW,OAAO;CAC1B,MAAM,EAAE,aAAa;CAErB,SAAS,6BAA6B;EACpC,iBAAiB;GACf,GAAG,MAAM,OAAO,WAAW;GAC3B,GAAG,IAAI,MAAM,CAAC,CAAC,OAAO,YAAY;EACpC,CAAC;EAED,GAAG,yDAAyD;GAC1D,GAAG,YAAY,OAAO,eAAe,CAAC,CAAC,MAAM;GAC7C,GAAG,IAAI,mBAAiB,CAAC,CAAC,OAAO,YAAY;GAE7C,GAAG,SAAS,qBAAmB,eAAe,CAAC,CAAC,OAAO,YAAY;EACrE,CAAC;EAED,GAAG,iEAAiE;GAClE,GAAG,YAAY,OAAO,eAAe,CAAC,CAAC,MAAM;GAC7C,GAAG,IAAI,mBAAiB,CAAC,CAAC,OAAO,YAAY;GAE7C,GAAG,IAAI,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bar: false,
|
|
52
|
+
detailTabInUrl: false,
|
|
53
|
+
welcomeGuide: false,
|
|
54
|
+
installBunAndNpmrc: false,
|
|
55
|
+
copyFeedback: false,
|
|
56
|
+
searchGrouping: false,
|
|
57
|
+
versionLink: false,
|
|
58
|
+
settingsPublishTab: false
|
|
59
|
+
},
|
|
60
|
+
provenance: { sidebarSection: false },
|
|
50
61
|
changePassword: {
|
|
51
62
|
happyPath: true,
|
|
52
63
|
validation: true,
|
|
@@ -108,6 +119,14 @@ function mergeFeatures(defaults, overrides) {
|
|
|
108
119
|
...defaults.signup,
|
|
109
120
|
...overrides.signup
|
|
110
121
|
},
|
|
122
|
+
homeDetailUx: {
|
|
123
|
+
...defaults.homeDetailUx,
|
|
124
|
+
...overrides.homeDetailUx
|
|
125
|
+
},
|
|
126
|
+
provenance: {
|
|
127
|
+
...defaults.provenance,
|
|
128
|
+
...overrides.provenance
|
|
129
|
+
},
|
|
111
130
|
changePassword: {
|
|
112
131
|
...defaults.changePassword,
|
|
113
132
|
...overrides.changePassword
|