Skip to content
This repository was archived by the owner on May 3, 2024. It is now read-only.

Commit bcc7f97

Browse files
committed
update fetch, fix failing tests
1 parent dca4f38 commit bcc7f97

File tree

43 files changed

+43416
-34012
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+43416
-34012
lines changed

1-Authentication/1-sign-in/SPA/src/sample.test.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ describe('Sanitize configuration object', () => {
3535
});
3636

3737
describe('Ensure that the app starts', () => {
38-
let handleRedirectSpy;
3938
let pca;
39+
let handleRedirectSpy;
40+
4041
beforeEach(() => {
4142
global.crypto = require('crypto');
4243
global.msalConfig = require('./authConfig.js').msalConfig;
@@ -55,8 +56,9 @@ describe('Ensure that the app starts', () => {
5556
ReactDOM.render(<App msalInstance={pca} />, div);
5657

5758
await waitFor(() => expect(handleRedirectSpy).toHaveBeenCalledTimes(1));
58-
expect(div.textContent).toBe(
59-
'Microsoft identity platformSign InWelcome to the Microsoft Authentication Library For React TutorialPlease sign-in to see your profile information.'
59+
60+
expect(div.textContent).toContain(
61+
'Welcome to the Microsoft Authentication Library For React Tutorial'
6062
);
6163
});
6264
});

1-Authentication/2-sign-in-b2c/SPA/src/sample.test.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import '@testing-library/jest-dom';
22
import { PublicClientApplication } from '@azure/msal-browser';
33
import { render, screen, waitFor } from '@testing-library/react';
4-
import { BrowserRouter } from 'react-router-dom';
54
import App from './App';
65

76
describe('Sanitize configuration object', () => {
@@ -29,8 +28,9 @@ describe('Sanitize configuration object', () => {
2928
});
3029

3130
describe('Ensure that the app starts', () => {
32-
let handleRedirectSpy;
3331
let pca;
32+
let handleRedirectSpy;
33+
3434
beforeEach(() => {
3535
global.crypto = require('crypto');
3636
global.msalConfig = require('./authConfig.js').msalConfig;
@@ -45,12 +45,11 @@ describe('Ensure that the app starts', () => {
4545

4646
it('should render the app without crashing', async () => {
4747
render(
48-
<BrowserRouter>
49-
<App instance={pca} />
50-
</BrowserRouter>
48+
<App instance={pca} />
5149
);
5250

5351
await waitFor(() => expect(handleRedirectSpy).toHaveBeenCalledTimes(1));
52+
5453
expect(
5554
await screen.findByText('Welcome to the Microsoft Authentication Library For React Tutorial')
5655
).toBeInTheDocument();

0 commit comments

Comments
 (0)