Skip to content

Commit 00561f1

Browse files
authored
test: set a specific default releaseVersionPattern for tested entities (#47)
1 parent cccdee6 commit 00561f1

File tree

10 files changed

+21
-24
lines changed

10 files changed

+21
-24
lines changed

src/test-data/portal/dashboards.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { DASHBOARD_PREFIX } from '@test-data'
22
import { Dashboard } from '@test-data/props'
33
import { G_REV_IMM, G_REV_VAR, P_GR_CRUD, VAR_GR } from './groups'
44
import { P_WS_MAIN_R } from './workspaces'
5+
import { RV_PATTERN_DEF } from '@test-data/portal/other'
56

67
export const D11 = new Dashboard({
78
name: `${DASHBOARD_PREFIX}-11`,
@@ -50,6 +51,7 @@ export const P_DSH_UPDATE = new Dashboard({
5051
alias: 'DUPDT',
5152
parent: P_GR_CRUD,
5253
description: 'For update',
54+
releaseVersionPattern: RV_PATTERN_DEF,
5355
testMeta: {
5456
updatedName: 'Updated',
5557
updatedServiceName: `dash-crud-${process.env.TEST_ID_N}`,

src/test-data/portal/packages.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
import { PACKAGE_PREFIX } from '@test-data'
22
import { Package } from '@test-data/props'
3-
import {
4-
G_PUBLISH_IMM,
5-
G_PUBLISH_VAR,
6-
G_REV_IMM,
7-
G_REV_VAR,
8-
G_SETTINGS_VAR,
9-
IMM_GR,
10-
P_GR_CRUD,
11-
VAR_GR,
12-
} from './groups'
13-
import { RV_PATTERN_NEW } from './other'
3+
import { G_PUBLISH_IMM, G_PUBLISH_VAR, G_REV_IMM, G_REV_VAR, G_SETTINGS_VAR, IMM_GR, P_GR_CRUD, VAR_GR } from './groups'
4+
import { RV_PATTERN_DEF, RV_PATTERN_NEW } from './other'
145
import { P_WS_MAIN_R } from './workspaces'
156

167
export const PK11 = new Package({
@@ -60,6 +51,7 @@ export const PK_PUB_IMM_1 = new Package({
6051
name: 'Publish-reusable-1',
6152
alias: 'PKPUBIMM1',
6253
parent: G_PUBLISH_IMM,
54+
releaseVersionPattern: RV_PATTERN_DEF,
6355
}, { kindPrefix: true })
6456
export const PK_PUB_IMM_2 = new Package({
6557
name: 'Publish-reusable-2',

src/test-data/portal/uac/admin/dashboards.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Dashboard } from '@test-data/props'
22
import { GRP_P_ADMIN_CRUD_N, GRP_P_ADMIN_ROOT_N } from './groups'
33
import { TOKEN_ADMIN_DASHBOARD } from './tokens'
4+
import { RV_PATTERN_DEF } from '@test-data/portal'
45

56
export const DSH_P_ADMIN_N = new Dashboard({
67
name: 'Admin',
@@ -14,6 +15,7 @@ export const DSH_P_ADMIN_EDITING_N = new Dashboard({
1415
alias: 'DADMINE',
1516
parent: GRP_P_ADMIN_CRUD_N,
1617
apiKeys: [TOKEN_ADMIN_DASHBOARD],
18+
releaseVersionPattern: RV_PATTERN_DEF,
1719
}, { kindPrefix: true })
1820

1921
export const DSH_P_ADMIN_DELETING_N = new Dashboard({

src/test-data/portal/uac/admin/groups.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Group } from '@test-data/props'
22
import { GRP_P_UAC_N } from '../general/groups'
33
import { TOKEN_ADMIN_GROUP } from './tokens'
4+
import { RV_PATTERN_DEF } from '@test-data/portal'
45

56
export const GRP_P_ADMIN_ROOT_N = new Group({
67
name: 'Admin',
@@ -26,6 +27,7 @@ export const GRP_P_ADMIN_EDITING_N = new Group({
2627
alias: 'GADMINE',
2728
parent: GRP_P_ADMIN_CRUD_N,
2829
apiKeys: [TOKEN_ADMIN_GROUP],
30+
releaseVersionPattern: RV_PATTERN_DEF,
2931
}, { kindPrefix: true })
3032

3133
export const GRP_P_ADMIN_DELETING_N = new Group({

src/test-data/portal/uac/admin/packages.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Package } from '@test-data/props'
22
import { GRP_P_ADMIN_CRUD_N, GRP_P_ADMIN_ROOT_N } from './groups'
33
import { TOKEN_ADMIN_PACKAGE } from './tokens'
4-
import { DEF_PREFIX_GROUP } from '@test-data/portal'
4+
import { DEF_PREFIX_GROUP, RV_PATTERN_DEF } from '@test-data/portal'
55

66
export const PKG_P_ADMIN_N = new Package({
77
name: 'Admin',
@@ -16,6 +16,7 @@ export const PKG_P_ADMIN_EDITING_N = new Package({
1616
alias: 'PADMINE',
1717
parent: GRP_P_ADMIN_CRUD_N,
1818
apiKeys: [TOKEN_ADMIN_PACKAGE],
19+
releaseVersionPattern: RV_PATTERN_DEF,
1920
}, { kindPrefix: true })
2021

2122
export const PKG_P_ADMIN_DELETING_N = new Package({

src/test-data/portal/uac/owner/dashboards.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Dashboard } from '@test-data/props'
22
import { GRP_P_OWNER_CRUD_N, GRP_P_OWNER_ROOT_N } from './groups'
33
import { TOKEN_OWNER_DASHBOARD } from './tokens'
4+
import { RV_PATTERN_DEF } from '@test-data/portal'
45

56
export const DSH_P_OWNER_N = new Dashboard({
67
name: 'Owner',
@@ -13,6 +14,7 @@ export const DSH_P_OWNER_EDITING_N = new Dashboard({
1314
name: 'Owner-editing',
1415
alias: 'DOWNERE',
1516
parent: GRP_P_OWNER_CRUD_N,
17+
releaseVersionPattern: RV_PATTERN_DEF,
1618
}, { kindPrefix: true })
1719

1820
export const DSH_P_OWNER_DELETING_N = new Dashboard({

src/test-data/portal/uac/owner/groups.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Group } from '@test-data/props'
22
import { GRP_P_UAC_N } from '../general/groups'
33
import { TOKEN_OWNER_GROUP } from './tokens'
4+
import { RV_PATTERN_DEF } from '@test-data/portal'
45

56
export const GRP_P_OWNER_ROOT_N = new Group({
67
name: 'Owner',
@@ -25,6 +26,7 @@ export const GRP_P_OWNER_EDITING_N = new Group({
2526
name: 'Owner-editing',
2627
alias: 'GOWNERE',
2728
parent: GRP_P_OWNER_CRUD_N,
29+
releaseVersionPattern: RV_PATTERN_DEF,
2830
}, { kindPrefix: true })
2931

3032
export const GRP_P_OWNER_DELETING_N = new Group({

src/test-data/portal/uac/owner/packages.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Package } from '@test-data/props'
22
import { GRP_P_OWNER_CRUD_N, GRP_P_OWNER_ROOT_N } from './groups'
33
import { TOKEN_OWNER_PACKAGE } from './tokens'
4-
import { DEF_PREFIX_GROUP } from '@test-data/portal'
4+
import { DEF_PREFIX_GROUP, RV_PATTERN_DEF } from '@test-data/portal'
55

66
export const PKG_P_OWNER_N = new Package({
77
name: 'Owner',
@@ -15,6 +15,7 @@ export const PKG_P_OWNER_EDITING_N = new Package({
1515
name: 'Owner-editing',
1616
alias: 'POWNERE',
1717
parent: GRP_P_OWNER_CRUD_N,
18+
releaseVersionPattern: RV_PATTERN_DEF,
1819
}, { kindPrefix: true })
1920

2021
export const PKG_P_OWNER_DELETING_N = new Package({

src/test-data/props/packages.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
import type {
2-
BasePackageParams,
3-
GroupParams,
4-
PackageKind,
5-
PackageParams,
6-
TestMetaBasePackage,
7-
WorkspaceParams,
8-
} from './params'
1+
import type { BasePackageParams, GroupParams, PackageKind, PackageParams, TestMetaBasePackage, WorkspaceParams } from './params'
92
import type { PackageApiKey } from '@shared/entities'
103
import { TEST_PREFIX } from '@test-data'
114
import process from 'node:process'
@@ -29,12 +22,14 @@ export class Workspace extends BasePackage {
2922
readonly packageId = this.alias
3023
readonly defaultRole?: string
3124
readonly apiKeys?: PackageApiKey[]
25+
readonly releaseVersionPattern?: string
3226

3327
constructor(params: WorkspaceParams, nameOptions?: NameOptions) {
3428
const _name = setName(params.name, 'WSP', nameOptions)
3529
super({ ...params, name: _name })
3630
this.defaultRole = params.defaultRole
3731
this.apiKeys = params.apiKeys
32+
this.releaseVersionPattern = params.releaseVersionPattern
3833
}
3934
}
4035

@@ -66,14 +61,12 @@ export class Group extends Workspace {
6661
export class Package extends Group {
6762
readonly kind: PackageKind = 'package'
6863
readonly serviceName?: string
69-
readonly releaseVersionPattern?: string
7064
readonly restGroupingPrefix?: string
7165

7266
constructor(params: PackageParams, nameOptions?: NameOptions) {
7367
const _name = setName(params.name, 'PKG', nameOptions)
7468
super({ ...params, name: _name })
7569
this.serviceName = params.serviceName
76-
this.releaseVersionPattern = params.releaseVersionPattern
7770
this.restGroupingPrefix = params.restGroupingPrefix
7871
}
7972

src/test-data/props/params.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export interface BasePackageParams {
2020
export interface WorkspaceParams extends BasePackageParams {
2121
readonly defaultRole?: string
2222
readonly apiKeys?: PackageApiKey[]
23+
releaseVersionPattern?: string
2324
}
2425

2526
export interface GroupParams extends WorkspaceParams {
@@ -28,7 +29,6 @@ export interface GroupParams extends WorkspaceParams {
2829

2930
export interface PackageParams extends GroupParams {
3031
serviceName?: string
31-
releaseVersionPattern?: string
3232
restGroupingPrefix?: string
3333
}
3434

0 commit comments

Comments
 (0)