Adds dev mode for tests (including file watch). Uri encodes the quiz url

parent 83ed133f
Pipeline #16194 passed with stages
in 5 minutes and 38 seconds
......@@ -19,6 +19,8 @@
"bundle-report": "webpack-bundle-analyzer dist/browser/stats.json",
"webpack:SERVER": "webpack --config webpack.server.config.js --progress --colors",
"test": "ng test --browsers=ChromeHeadless --watch=false --source-map=false",
"test:DEV": "ng test --browsers=Chrome --karma-config=src/karma.conf.dev.js --source-map=false",
"test:DEV:HEADLESS": "ng test --browsers=ChromeHeadless --karma-config=src/karma.conf.dev.js --source-map=false",
"lint": "ng lint",
"pree2e": "webdriver-manager update --standalone false --gecko false",
"e2e": "ng e2e --no-webdriver-update",
......
......@@ -42,7 +42,7 @@
<h5 class="text-center">{{'component.quiz_summary.quiz_url' | translate}}</h5>
<p class="mb-0 text-wrap"
role="listitem">
<span>{{document.location.origin + '/quiz/' + questionGroupItem.hashtag}}</span>
<span>{{quizUrl}}</span>
</p>
</div>
</div>
......
......@@ -13,6 +13,10 @@ export class AdditionalDataComponent {
public static TYPE = 'AdditionalDataComponent';
public readonly questionGroupItem: IQuestionGroup;
get quizUrl(): string {
return this._quizUrl;
}
private _isShowingMore: boolean = window.innerWidth >= 768;
get isShowingMore(): boolean {
......@@ -23,12 +27,15 @@ export class AdditionalDataComponent {
this._isShowingMore = value;
}
private readonly _quizUrl: string;
constructor(
@Inject(DOCUMENT) readonly document,
private activeQuestionGroupService: ActiveQuestionGroupService,
private trackingService: TrackingService,
) {
this.questionGroupItem = activeQuestionGroupService.activeQuestionGroup;
this._quizUrl = encodeURI(`${document.location.origin}/quiz/${this.questionGroupItem.hashtag}`);
}
public switchShowMoreOrLess(): void {
......
......@@ -20,8 +20,19 @@ module.exports = function (config) {
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
},
customLaunchers: {
ChromeHeadless: {
base: 'Chrome',
flags: [
'--headless',
'--disable-gpu',
'--no-sandbox',
'--remote-debugging-port=9222',
],
}
},
mime: {
'text/x-typescript': ['ts','tsx']
'text/x-typescript': ['ts', 'tsx']
},
reporters: config.angularCli && config.angularCli.codeCoverage
? ['progress', 'coverage-istanbul']
......@@ -30,7 +41,7 @@ module.exports = function (config) {
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
browsers: ['ChromeHeadless'],
singleRun: false
});
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment