-
Notifications
You must be signed in to change notification settings - Fork 395
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: schematics for 2 guides: 'modernize-app-migrated-from-6_8-to-22…
…11_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
- Loading branch information
Showing
38 changed files
with
2,678 additions
and
0 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
...ze-app-migrated-from-2211_32-to-2211_35/integration-test/__fixtures__/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
This folder contains the fixtures for the integration tests | ||
- `/app-ssr` - an excerpt from a real **SSR** app migrated from Spartacus 2211.32 (ng17) to v2211.35 (ng19) | ||
- `/app-csr` - an excerpt from a real **CSR** app migrated from Spartacus 2211.32 (ng17) to v2211.35 (ng19) |
147 changes: 147 additions & 0 deletions
147
...grated-from-2211_32-to-2211_35/integration-test/__fixtures__/app-csr/angular.json.fixture
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
{ | ||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", | ||
"version": 1, | ||
"newProjectRoot": "projects", | ||
"projects": { | ||
"test-app-migrated-from-2211_32-to-2211_35-csr": { | ||
"projectType": "application", | ||
"schematics": { | ||
"@schematics/angular:component": { | ||
"style": "scss", | ||
"standalone": false | ||
}, | ||
"@schematics/angular:directive": { | ||
"standalone": false | ||
}, | ||
"@schematics/angular:pipe": { | ||
"standalone": false | ||
} | ||
}, | ||
"root": "", | ||
"sourceRoot": "src", | ||
"prefix": "app", | ||
"architect": { | ||
"build": { | ||
"builder": "@angular-devkit/build-angular:application", | ||
"options": { | ||
"outputPath": "dist/test-app-migrated-from-2211_32-to-2211_35-csr", | ||
"index": "src/index.html", | ||
"browser": "src/main.ts", | ||
"polyfills": [ | ||
"zone.js" | ||
], | ||
"tsConfig": "tsconfig.app.json", | ||
"inlineStyleLanguage": "scss", | ||
"assets": [ | ||
"src/favicon.ico", | ||
"src/assets", | ||
{ | ||
"glob": "**/*", | ||
"input": "./node_modules/@spartacus/smartedit/assets", | ||
"output": "assets/" | ||
} | ||
], | ||
"styles": [ | ||
"src/styles.scss", | ||
"src/styles/spartacus/user.scss", | ||
"src/styles/spartacus/cart.scss", | ||
"src/styles/spartacus/order.scss", | ||
"src/styles/spartacus/checkout.scss", | ||
"src/styles/spartacus/storefinder.scss", | ||
"src/styles/spartacus/asm.scss", | ||
"src/styles/spartacus/product.scss" | ||
], | ||
"scripts": [], | ||
"stylePreprocessorOptions": { | ||
"includePaths": [ | ||
"node_modules/" | ||
], | ||
"sass": { | ||
"silenceDeprecations": [ | ||
"import" | ||
] | ||
} | ||
} | ||
}, | ||
"configurations": { | ||
"production": { | ||
"budgets": [ | ||
{ | ||
"type": "initial", | ||
"maximumWarning": "500kb", | ||
"maximumError": "3.5mb" | ||
}, | ||
{ | ||
"type": "anyComponentStyle", | ||
"maximumWarning": "2kb", | ||
"maximumError": "4kb" | ||
} | ||
], | ||
"outputHashing": "all" | ||
}, | ||
"development": { | ||
"optimization": false, | ||
"extractLicenses": false, | ||
"sourceMap": true | ||
} | ||
}, | ||
"defaultConfiguration": "production" | ||
}, | ||
"serve": { | ||
"builder": "@angular-devkit/build-angular:dev-server", | ||
"configurations": { | ||
"production": { | ||
"buildTarget": "test-app-migrated-from-2211_32-to-2211_35-csr:build:production" | ||
}, | ||
"development": { | ||
"buildTarget": "test-app-migrated-from-2211_32-to-2211_35-csr:build:development" | ||
} | ||
}, | ||
"defaultConfiguration": "development" | ||
}, | ||
"extract-i18n": { | ||
"builder": "@angular-devkit/build-angular:extract-i18n", | ||
"options": { | ||
"buildTarget": "test-app-migrated-from-2211_32-to-2211_35-csr:build" | ||
} | ||
}, | ||
"test": { | ||
"builder": "@angular-devkit/build-angular:karma", | ||
"options": { | ||
"polyfills": [ | ||
"zone.js", | ||
"zone.js/testing" | ||
], | ||
"tsConfig": "tsconfig.spec.json", | ||
"inlineStyleLanguage": "scss", | ||
"assets": [ | ||
"src/favicon.ico", | ||
"src/assets", | ||
{ | ||
"glob": "**/*", | ||
"input": "./node_modules/@spartacus/smartedit/assets", | ||
"output": "assets/" | ||
} | ||
], | ||
"styles": [ | ||
"src/styles.scss", | ||
"src/styles/spartacus/user.scss", | ||
"src/styles/spartacus/cart.scss", | ||
"src/styles/spartacus/order.scss", | ||
"src/styles/spartacus/checkout.scss", | ||
"src/styles/spartacus/storefinder.scss", | ||
"src/styles/spartacus/asm.scss", | ||
"src/styles/spartacus/product.scss" | ||
], | ||
"scripts": [], | ||
"stylePreprocessorOptions": { | ||
"includePaths": [ | ||
"node_modules/" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
...ion-test/__fixtures__/app-csr/src/app/spartacus/spartacus-configuration.module.ts.fixture
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { translationChunksConfig } from '@spartacus/assets'; | ||
import { | ||
FeaturesConfig, | ||
I18nConfig, | ||
OccConfig, | ||
provideConfig, | ||
SiteContextConfig, | ||
} from '@spartacus/core'; | ||
import { | ||
defaultCmsContentProviders, | ||
layoutConfig, | ||
mediaConfig, | ||
} from '@spartacus/storefront'; | ||
|
||
@NgModule({ | ||
declarations: [], | ||
imports: [], | ||
providers: [ | ||
provideConfig(layoutConfig), | ||
provideConfig(mediaConfig), | ||
...defaultCmsContentProviders, | ||
provideConfig(<OccConfig>{ | ||
backend: { | ||
occ: { | ||
baseUrl: 'https://40.76.109.9:9002', | ||
}, | ||
}, | ||
}), | ||
provideConfig(<SiteContextConfig>{ | ||
context: {}, | ||
}), | ||
provideConfig(<I18nConfig>{ | ||
i18n: { | ||
backend: { | ||
loader: (language: string, chunkName: string) => { | ||
return import( | ||
`../../assets/i18n-assets/${language}/${chunkName}.json` | ||
); | ||
}, | ||
}, | ||
chunks: translationChunksConfig, | ||
fallbackLang: 'en', | ||
}, | ||
}), | ||
provideConfig(<FeaturesConfig>{ | ||
features: { | ||
level: '2211.32', | ||
}, | ||
}), | ||
], | ||
}) | ||
export class SpartacusConfigurationModule {} |
5 changes: 5 additions & 0 deletions
5
...-to-2211_35/integration-test/__fixtures__/app-csr/src/assets/i18n-assets/pdf.json.fixture
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"pdf": { | ||
"defaultTitle": "Document" | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...o-2211_35/integration-test/__fixtures__/app-csr/src/assets/i18n-assets/video.json.fixture
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"player": { | ||
"label": "Video Player" | ||
} | ||
} |
Binary file added
BIN
+14.7 KB
...ted-from-2211_32-to-2211_35/integration-test/__fixtures__/app-csr/src/favicon.ico.fixture
Binary file not shown.
7 changes: 7 additions & 0 deletions
7
...igrated-from-2211_32-to-2211_35/integration-test/__fixtures__/app-csr/src/main.ts.fixture
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; | ||
|
||
import { AppModule } from './app/app.module'; | ||
|
||
|
||
platformBrowserDynamic().bootstrapModule(AppModule) | ||
.catch(err => console.error(err)); |
32 changes: 32 additions & 0 deletions
32
...rated-from-2211_32-to-2211_35/integration-test/__fixtures__/app-csr/tsconfig.json.fixture
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* To learn more about this file see: https://angular.io/config/tsconfig. */ | ||
{ | ||
"compileOnSave": false, | ||
"compilerOptions": { | ||
"outDir": "./dist/out-tsc", | ||
"strict": true, | ||
"noImplicitOverride": true, | ||
"noPropertyAccessFromIndexSignature": true, | ||
"noImplicitReturns": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"skipLibCheck": true, | ||
"esModuleInterop": true, | ||
"sourceMap": true, | ||
"declaration": false, | ||
"experimentalDecorators": true, | ||
"moduleResolution": "node", | ||
"importHelpers": true, | ||
"target": "ES2022", | ||
"module": "ES2022", | ||
"useDefineForClassFields": false, | ||
"lib": [ | ||
"ES2022", | ||
"dom" | ||
] | ||
}, | ||
"angularCompilerOptions": { | ||
"enableI18nLegacyMessageIdFormat": false, | ||
"strictInjectionParameters": true, | ||
"strictInputAccessModifiers": true, | ||
"strictTemplates": true | ||
} | ||
} |
Oops, something went wrong.