Skip to content

Commit 9a0e36c

Browse files
committed
try to fix broken tests
1 parent ebfc97f commit 9a0e36c

5 files changed

Lines changed: 17 additions & 9 deletions

File tree

1-Authentication/2-sign-in-angular/SPA/angular.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@
1616
"outputPath": "dist/1-sign-in-angular",
1717
"index": "src/index.html",
1818
"main": "src/main.ts",
19-
"polyfills": "src/polyfills.ts",
19+
// "polyfills": "src/polyfills.ts",
20+
"polyfills": [
21+
"zone.js",
22+
"zone.js/testing"
23+
],
2024
"tsConfig": "tsconfig.app.json",
2125
"assets": [
2226
"src/favicon.ico",

1-Authentication/2-sign-in-angular/SPA/src/app/auth-config.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ import {
1818
*/
1919
export const msalConfig: Configuration = {
2020
auth: {
21-
// clientId: 'Enter_the_Application_Id_Here', // This is the ONLY mandatory field that you need to supply.
22-
// authority: 'https://Enter_the_Tenant_Subdomain_Here.ciamlogin.com/', // Replace the placeholder with your tenant subdomain
23-
clientId: '94fc755a-af32-43f9-9ce6-5f86f2beb928', // This is the ONLY mandatory field that you need to supply.
24-
authority: 'https://TrialTenantkwFwHYij.ciamlogin.com/', // Replace the placeholder with your tenant subdomain
21+
clientId: 'Enter_the_Application_Id_Here', // This is the ONLY mandatory field that you need to supply.
22+
authority: 'https://Enter_the_Tenant_Subdomain_Here.ciamlogin.com/', // Replace the placeholder with your tenant subdomain
2523
redirectUri: '/', // Points to window.location.origin by default. You must register this URI on Azure portal/App Registration.
2624
postLogoutRedirectUri: '/', // Points to window.location.origin by default.
2725
},

1-Authentication/2-sign-in-angular/SPA/src/app/sample.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { Router } from '@angular/router';
1+
import "zone.js/testing";
2+
import { provideRouter, Router } from '@angular/router';
23
import { ComponentFixture, TestBed } from '@angular/core/testing';
3-
import { RouterTestingModule } from '@angular/router/testing';
4+
// import { RouterTestingHarness } from '@angular/router/testing';
45

56
import { MSAL_GUARD_CONFIG, MsalGuardConfiguration } from '@azure/msal-angular';
67
import { InteractionType } from '@azure/msal-browser';
@@ -74,7 +75,7 @@ function setup() {
7475
TestBed.configureTestingModule({
7576
imports: [
7677
AppModule,
77-
RouterTestingModule,
78+
provideRouter,
7879
],
7980
providers: [
8081
{

1-Authentication/2-sign-in-angular/SPA/src/polyfills.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
* Zone JS is required by default for Angular itself.
4747
*/
4848
import 'zone.js'; // Included with Angular CLI.
49+
import 'zone.js/testing';
4950

5051

5152
/***************************************************************************************************

1-Authentication/2-sign-in-angular/SPA/tsconfig.spec.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
],
1414
"include": [
1515
"src/**/*.spec.ts",
16-
"src/**/*.d.ts"
16+
"src/**/*.d.ts",
17+
"src/**/*.ts"
18+
// "**/*.spec.ts",
19+
// "**/*.d.ts",
20+
// "**/*.ts"
1721
]
1822
}

0 commit comments

Comments
 (0)