@7365admin1/layer-common 4.0.3-staging.233 → 4.0.3-staging.234
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/package.json +3 -2
- package/utils/breadcrumb.test.ts +0 -108
- package/utils/camera-wall.test.ts +0 -634
- package/utils/client-nature.test.ts +0 -77
- package/utils/client-subscription.test.ts +0 -240
- package/utils/console-tier.test.ts +0 -87
- package/utils/dashboard.test.ts +0 -118
- package/utils/data.test.ts +0 -179
- package/utils/hid-discover.test.ts +0 -115
- package/utils/list-page.test.ts +0 -60
- package/utils/nav-sections.test.ts +0 -190
- package/utils/nfc-patrol-report.test.ts +0 -130
- package/utils/promo-code-form.test.ts +0 -437
- package/utils/role.test.ts +0 -69
- package/utils/route-name.test.ts +0 -85
- package/utils/status.test.ts +0 -110
- package/utils/subscription-form.test.ts +0 -284
- package/utils/table-card.test.ts +0 -84
- package/utils/theme.test.ts +0 -679
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@7365admin1/layer-common",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "4.0.3-staging.
|
|
5
|
+
"version": "4.0.3-staging.234",
|
|
6
6
|
"author": "7365admin1",
|
|
7
7
|
"main": "./nuxt.config.ts",
|
|
8
8
|
"//files": "What a consumer extending this layer actually loads. Without this npm ships the whole working tree - the changesets, the CI workflows, the render harness in tools/ and any scratch directory that happened to exist at publish time. Nuxt resolves a layer by directory, so every runtime directory below has to stay listed; adding a new top-level runtime directory means adding it here too.",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"public",
|
|
25
25
|
"services",
|
|
26
26
|
"types",
|
|
27
|
-
"utils"
|
|
27
|
+
"utils",
|
|
28
|
+
"!**/*.test.ts"
|
|
28
29
|
],
|
|
29
30
|
"publishConfig": {
|
|
30
31
|
"access": "public"
|
package/utils/breadcrumb.test.ts
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { test } from "node:test";
|
|
3
|
-
|
|
4
|
-
import { moduleNameFromRoute } from "./breadcrumb.ts";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Real routes, not invented ones: name, path and parameters exactly as
|
|
8
|
-
* vue-router hands them to the bar in each application.
|
|
9
|
-
*/
|
|
10
|
-
const ID = "68b0c1d2e3f4a5b6c7d8e9f0";
|
|
11
|
-
|
|
12
|
-
test("a site application names the page, not its parameters", () => {
|
|
13
|
-
assert.equal(
|
|
14
|
-
moduleNameFromRoute({
|
|
15
|
-
name: "org-site-work-orders",
|
|
16
|
-
path: `/${ID}/${ID}/work-orders`,
|
|
17
|
-
params: { org: ID, site: ID },
|
|
18
|
-
}),
|
|
19
|
-
"Work Orders"
|
|
20
|
-
);
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
test("a detail route names its module, not its argument", () => {
|
|
24
|
-
assert.equal(
|
|
25
|
-
moduleNameFromRoute({
|
|
26
|
-
name: "org-site-feedbacks-id",
|
|
27
|
-
path: `/${ID}/${ID}/feedbacks/${ID}`,
|
|
28
|
-
params: { org: ID, site: ID, id: ID },
|
|
29
|
-
}),
|
|
30
|
-
"Feedbacks"
|
|
31
|
-
);
|
|
32
|
-
assert.equal(
|
|
33
|
-
moduleNameFromRoute({
|
|
34
|
-
name: "org-site-members-status",
|
|
35
|
-
path: `/${ID}/${ID}/members/pending`,
|
|
36
|
-
params: { org: ID, site: ID, status: "pending" },
|
|
37
|
-
}),
|
|
38
|
-
"Members"
|
|
39
|
-
);
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
test("a fixed folder in front of the context parameter is not the page", () => {
|
|
43
|
-
// THE DEFECT: every screen of the organization application read "Org".
|
|
44
|
-
assert.equal(
|
|
45
|
-
moduleNameFromRoute({
|
|
46
|
-
name: "org-organization-marketplace",
|
|
47
|
-
path: `/org/${ID}/marketplace`,
|
|
48
|
-
params: { organization: ID },
|
|
49
|
-
}),
|
|
50
|
-
"Marketplace"
|
|
51
|
-
);
|
|
52
|
-
assert.equal(
|
|
53
|
-
moduleNameFromRoute({
|
|
54
|
-
name: "org-organization-payment-methods-linked",
|
|
55
|
-
path: `/org/${ID}/payment-methods/linked`,
|
|
56
|
-
params: { organization: ID },
|
|
57
|
-
}),
|
|
58
|
-
"Payment Methods Linked"
|
|
59
|
-
);
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
test("a literal second segment is NOT a skipped context", () => {
|
|
63
|
-
// `/organizations/status/:status` also begins with a literal folder, but
|
|
64
|
-
// "Organizations" is the page here - only the THIRD segment is a parameter.
|
|
65
|
-
assert.equal(
|
|
66
|
-
moduleNameFromRoute({
|
|
67
|
-
name: "organizations-status-status",
|
|
68
|
-
path: "/organizations/status/pending",
|
|
69
|
-
params: { status: "pending" },
|
|
70
|
-
}),
|
|
71
|
-
"Organizations"
|
|
72
|
-
);
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
test("a route with no parameters is left alone", () => {
|
|
76
|
-
assert.equal(
|
|
77
|
-
moduleNameFromRoute({
|
|
78
|
-
name: "super-admin-client-list",
|
|
79
|
-
path: "/super-admin/client-list",
|
|
80
|
-
params: {},
|
|
81
|
-
}),
|
|
82
|
-
"Super Admin Client List"
|
|
83
|
-
);
|
|
84
|
-
assert.equal(
|
|
85
|
-
moduleNameFromRoute({ name: "personal-info-name", path: "/personal-info/name", params: {} }),
|
|
86
|
-
"Personal Info Name"
|
|
87
|
-
);
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
test("acronyms keep their case", () => {
|
|
91
|
-
assert.equal(
|
|
92
|
-
moduleNameFromRoute({
|
|
93
|
-
name: "org-site-virtual-patrol-cctv",
|
|
94
|
-
path: `/${ID}/${ID}/virtual-patrol/cctv`,
|
|
95
|
-
params: { org: ID, site: ID },
|
|
96
|
-
}),
|
|
97
|
-
"Virtual Patrol CCTV"
|
|
98
|
-
);
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
test("a context-only route has no page half", () => {
|
|
102
|
-
// The organization dashboard: the bar shows the organization's name alone.
|
|
103
|
-
assert.equal(
|
|
104
|
-
moduleNameFromRoute({ name: "org-organization", path: `/org/${ID}`, params: { organization: ID } }),
|
|
105
|
-
""
|
|
106
|
-
);
|
|
107
|
-
assert.equal(moduleNameFromRoute({ name: "", path: "/", params: {} }), "");
|
|
108
|
-
});
|