Skip to content

Commit 7231a92

Browse files
authored
test: schematics for 2 guides: 'modernize-app-migrated-from-6_8-to-2211_19' and 'modernize-app-migrated-from-2211_32-2211_35' (integration tests) (#19975)
This PR introduces a new subfolder `/integration-test` to both folders: - `modernize-app-migrated-from-6_8-to-2211_19/` - `modernize-app-migrated-from-2211_32-2211_35/` Each `/integration-test` folder contains: - tests for CSR app and SSR app: `app-csr_spec.ts` and `app-ssr_spec.ts` - `__fixtures__` folder which contains 2 excerpts of real applications - one in CSR and the other in SSR. Those apps were previously created and then migrated to a relevant higher version. related to https://jira.tools.sap/browse/CXSPA-9304
1 parent f092426 commit 7231a92

38 files changed

+2678
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This folder contains the fixtures for the integration tests
2+
- `/app-ssr` - an excerpt from a real **SSR** app migrated from Spartacus 2211.32 (ng17) to v2211.35 (ng19)
3+
- `/app-csr` - an excerpt from a real **CSR** app migrated from Spartacus 2211.32 (ng17) to v2211.35 (ng19)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"test-app-migrated-from-2211_32-to-2211_35-csr": {
7+
"projectType": "application",
8+
"schematics": {
9+
"@schematics/angular:component": {
10+
"style": "scss",
11+
"standalone": false
12+
},
13+
"@schematics/angular:directive": {
14+
"standalone": false
15+
},
16+
"@schematics/angular:pipe": {
17+
"standalone": false
18+
}
19+
},
20+
"root": "",
21+
"sourceRoot": "src",
22+
"prefix": "app",
23+
"architect": {
24+
"build": {
25+
"builder": "@angular-devkit/build-angular:application",
26+
"options": {
27+
"outputPath": "dist/test-app-migrated-from-2211_32-to-2211_35-csr",
28+
"index": "src/index.html",
29+
"browser": "src/main.ts",
30+
"polyfills": [
31+
"zone.js"
32+
],
33+
"tsConfig": "tsconfig.app.json",
34+
"inlineStyleLanguage": "scss",
35+
"assets": [
36+
"src/favicon.ico",
37+
"src/assets",
38+
{
39+
"glob": "**/*",
40+
"input": "./node_modules/@spartacus/smartedit/assets",
41+
"output": "assets/"
42+
}
43+
],
44+
"styles": [
45+
"src/styles.scss",
46+
"src/styles/spartacus/user.scss",
47+
"src/styles/spartacus/cart.scss",
48+
"src/styles/spartacus/order.scss",
49+
"src/styles/spartacus/checkout.scss",
50+
"src/styles/spartacus/storefinder.scss",
51+
"src/styles/spartacus/asm.scss",
52+
"src/styles/spartacus/product.scss"
53+
],
54+
"scripts": [],
55+
"stylePreprocessorOptions": {
56+
"includePaths": [
57+
"node_modules/"
58+
],
59+
"sass": {
60+
"silenceDeprecations": [
61+
"import"
62+
]
63+
}
64+
}
65+
},
66+
"configurations": {
67+
"production": {
68+
"budgets": [
69+
{
70+
"type": "initial",
71+
"maximumWarning": "500kb",
72+
"maximumError": "3.5mb"
73+
},
74+
{
75+
"type": "anyComponentStyle",
76+
"maximumWarning": "2kb",
77+
"maximumError": "4kb"
78+
}
79+
],
80+
"outputHashing": "all"
81+
},
82+
"development": {
83+
"optimization": false,
84+
"extractLicenses": false,
85+
"sourceMap": true
86+
}
87+
},
88+
"defaultConfiguration": "production"
89+
},
90+
"serve": {
91+
"builder": "@angular-devkit/build-angular:dev-server",
92+
"configurations": {
93+
"production": {
94+
"buildTarget": "test-app-migrated-from-2211_32-to-2211_35-csr:build:production"
95+
},
96+
"development": {
97+
"buildTarget": "test-app-migrated-from-2211_32-to-2211_35-csr:build:development"
98+
}
99+
},
100+
"defaultConfiguration": "development"
101+
},
102+
"extract-i18n": {
103+
"builder": "@angular-devkit/build-angular:extract-i18n",
104+
"options": {
105+
"buildTarget": "test-app-migrated-from-2211_32-to-2211_35-csr:build"
106+
}
107+
},
108+
"test": {
109+
"builder": "@angular-devkit/build-angular:karma",
110+
"options": {
111+
"polyfills": [
112+
"zone.js",
113+
"zone.js/testing"
114+
],
115+
"tsConfig": "tsconfig.spec.json",
116+
"inlineStyleLanguage": "scss",
117+
"assets": [
118+
"src/favicon.ico",
119+
"src/assets",
120+
{
121+
"glob": "**/*",
122+
"input": "./node_modules/@spartacus/smartedit/assets",
123+
"output": "assets/"
124+
}
125+
],
126+
"styles": [
127+
"src/styles.scss",
128+
"src/styles/spartacus/user.scss",
129+
"src/styles/spartacus/cart.scss",
130+
"src/styles/spartacus/order.scss",
131+
"src/styles/spartacus/checkout.scss",
132+
"src/styles/spartacus/storefinder.scss",
133+
"src/styles/spartacus/asm.scss",
134+
"src/styles/spartacus/product.scss"
135+
],
136+
"scripts": [],
137+
"stylePreprocessorOptions": {
138+
"includePaths": [
139+
"node_modules/"
140+
]
141+
}
142+
}
143+
}
144+
}
145+
}
146+
}
147+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import { NgModule } from '@angular/core';
2+
import { translationChunksConfig } from '@spartacus/assets';
3+
import {
4+
FeaturesConfig,
5+
I18nConfig,
6+
OccConfig,
7+
provideConfig,
8+
SiteContextConfig,
9+
} from '@spartacus/core';
10+
import {
11+
defaultCmsContentProviders,
12+
layoutConfig,
13+
mediaConfig,
14+
} from '@spartacus/storefront';
15+
16+
@NgModule({
17+
declarations: [],
18+
imports: [],
19+
providers: [
20+
provideConfig(layoutConfig),
21+
provideConfig(mediaConfig),
22+
...defaultCmsContentProviders,
23+
provideConfig(<OccConfig>{
24+
backend: {
25+
occ: {
26+
baseUrl: 'https://40.76.109.9:9002',
27+
},
28+
},
29+
}),
30+
provideConfig(<SiteContextConfig>{
31+
context: {},
32+
}),
33+
provideConfig(<I18nConfig>{
34+
i18n: {
35+
backend: {
36+
loader: (language: string, chunkName: string) => {
37+
return import(
38+
`../../assets/i18n-assets/${language}/${chunkName}.json`
39+
);
40+
},
41+
},
42+
chunks: translationChunksConfig,
43+
fallbackLang: 'en',
44+
},
45+
}),
46+
provideConfig(<FeaturesConfig>{
47+
features: {
48+
level: '2211.32',
49+
},
50+
}),
51+
],
52+
})
53+
export class SpartacusConfigurationModule {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"pdf": {
3+
"defaultTitle": "Document"
4+
}
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"player": {
3+
"label": "Video Player"
4+
}
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2+
3+
import { AppModule } from './app/app.module';
4+
5+
6+
platformBrowserDynamic().bootstrapModule(AppModule)
7+
.catch(err => console.error(err));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
2+
{
3+
"compileOnSave": false,
4+
"compilerOptions": {
5+
"outDir": "./dist/out-tsc",
6+
"strict": true,
7+
"noImplicitOverride": true,
8+
"noPropertyAccessFromIndexSignature": true,
9+
"noImplicitReturns": true,
10+
"noFallthroughCasesInSwitch": true,
11+
"skipLibCheck": true,
12+
"esModuleInterop": true,
13+
"sourceMap": true,
14+
"declaration": false,
15+
"experimentalDecorators": true,
16+
"moduleResolution": "node",
17+
"importHelpers": true,
18+
"target": "ES2022",
19+
"module": "ES2022",
20+
"useDefineForClassFields": false,
21+
"lib": [
22+
"ES2022",
23+
"dom"
24+
]
25+
},
26+
"angularCompilerOptions": {
27+
"enableI18nLegacyMessageIdFormat": false,
28+
"strictInjectionParameters": true,
29+
"strictInputAccessModifiers": true,
30+
"strictTemplates": true
31+
}
32+
}

0 commit comments

Comments
 (0)