Skip to content

Commit ec094d8

Browse files
author
Prithvi Kanherkar
authored
Merge pull request #1855 from AzureAD/sample-folders-change
Update sample folder structure
2 parents 53fc3fc + 9345d13 commit ec094d8

File tree

317 files changed

+21
-23
lines changed

Some content is hidden

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

317 files changed

+21
-23
lines changed

lerna.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"packages": [
1717
"lib/*",
18-
"samples/*"
18+
"samples/**/*"
1919
],
2020
"version": "independent",
2121
"concurrency": 2

samples/VanillaJSTestApp2.0/Readme.md renamed to samples/msal-browser-samples/VanillaJSTestApp2.0/Readme.md

+1-1

samples/VanillaJSTestApp2.0/app/default/index.html renamed to samples/msal-browser-samples/VanillaJSTestApp2.0/app/default/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<!-- IE support: add promises polyfill before msal.js -->
99
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/[email protected]/js/browser/bluebird.min.js"></script>
10-
<script src="../lib/msal-browser.js"></script>
10+
<script src="../../lib/msal-browser.js"></script>
1111

1212
<!-- adding Bootstrap 4 for UI components -->
1313
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">

samples/VanillaJSTestApp2.0/app/multipleResources/auth.js renamed to samples/msal-browser-samples/VanillaJSTestApp2.0/app/multipleResources/auth.js

-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ function handleResponse(resp) {
2525
if (resp !== null) {
2626
username = resp.account.username;
2727
showWelcomeMessage(resp.account);
28-
getTokenRedirect(tokenRequest, resp.account);
2928
} else {
3029
// need to call getAccount here?
3130
const currentAccounts = myMSALObj.getAllAccounts();
@@ -36,7 +35,6 @@ function handleResponse(resp) {
3635
} else if (currentAccounts.length === 1) {
3736
username = currentAccounts[0].username;
3837
showWelcomeMessage(currentAccounts[0]);
39-
getTokenRedirect(tokenRequest, currentAccounts[0]);
4038
}
4139
}
4240
}

samples/VanillaJSTestApp2.0/app/multipleResources/authConfig.js renamed to samples/msal-browser-samples/VanillaJSTestApp2.0/app/multipleResources/authConfig.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const msalConfig = {
1212

1313
// Add here scopes for id token to be used at MS Identity Platform endpoints.
1414
const loginRequest = {
15-
scopes: ["User.Read", "https://msidlab0.spoppe.com/user.read"],
15+
scopes: ["User.Read"],
1616
redirectUri: "http://localhost:30662/"
1717
};
1818

samples/VanillaJSTestApp2.0/app/multipleResources/index.html renamed to samples/msal-browser-samples/VanillaJSTestApp2.0/app/multipleResources/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<!-- IE support: add promises polyfill before msal.js -->
99
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/[email protected]/js/browser/bluebird.min.js"></script>
10-
<script src="../lib/msal-browser.js"></script>
10+
<script src="../../lib/msal-browser.js"></script>
1111

1212
<!-- adding Bootstrap 4 for UI components -->
1313
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">

samples/VanillaJSTestApp2.0/app/multipleResources/test/multiple_resources.spec.ts renamed to samples/msal-browser-samples/VanillaJSTestApp2.0/app/multipleResources/test/multiple_resources.spec.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ async function enterCredentials(page: puppeteer.Page, testName: string): Promise
4949
await page.click("#idSIButton9");
5050
}
5151

52-
describe.skip("Browser tests", function () {
52+
describe("Browser tests", function () {
5353
this.timeout(0);
5454
this.retries(1);
5555

@@ -81,7 +81,7 @@ describe.skip("Browser tests", function () {
8181
await browser.close();
8282
});
8383

84-
it.skip("Performs loginRedirect and acquires 2 tokens", async () => {
84+
it("Performs loginRedirect and acquires 2 tokens", async () => {
8585
const testName = "multipleResources";
8686
// Home Page
8787
await takeScreenshot(page, testName, `samplePageInit`);
@@ -110,6 +110,6 @@ describe.skip("Browser tests", function () {
110110
await page.waitForSelector("#second-resource-div");
111111
await takeScreenshot(page, testName, `secondToken`);
112112
sessionStorage = await page.evaluate(() => Object.assign({}, window.sessionStorage));
113-
expect(Object.keys(sessionStorage).length).to.be.eq(4);
113+
expect(Object.keys(sessionStorage).length).to.be.eq(5);
114114
});
115115
});

samples/VanillaJSTestApp2.0/app/ssoSilent/index.html renamed to samples/msal-browser-samples/VanillaJSTestApp2.0/app/onPageLoad/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<!-- IE support: add promises polyfill before msal.js -->
99
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/[email protected]/js/browser/bluebird.min.js"></script>
10-
<script src="../lib/msal-browser.js"></script>
10+
<script src="../../lib/msal-browser.js"></script>
1111

1212
<!-- adding Bootstrap 4 for UI components -->
1313
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">

samples/VanillaJSTestApp2.0/app/onPageLoad/index.html renamed to samples/msal-browser-samples/VanillaJSTestApp2.0/app/ssoSilent/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<!-- IE support: add promises polyfill before msal.js -->
99
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/[email protected]/js/browser/bluebird.min.js"></script>
10-
<script src="../lib/msal-browser.js"></script>
10+
<script src="../../lib/msal-browser.js"></script>
1111

1212
<!-- adding Bootstrap 4 for UI components -->
1313
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">

samples/VanillaJSTestApp2.0/e2eTests/testRunner.ts renamed to samples/msal-browser-samples/VanillaJSTestApp2.0/e2eTests/testRunner.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function runMochaTests(sampleIndex: number) {
5353
app.use(morgan('dev'));
5454

5555
// Set the front-end folder to serve public assets.
56-
app.use("/lib", express.static(path.join(PARENT_DIR, "../../lib/msal-browser/lib")));
56+
app.use("/lib", express.static(path.join(PARENT_DIR, "../../../lib/msal-browser/lib")));
5757

5858
let sampleName = sampleFolders[sampleIndex];
5959
const mocha = createMochaObject(sampleName);

samples/VanillaJSTestApp2.0/package.json renamed to samples/msal-browser-samples/VanillaJSTestApp2.0/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"main": "server.js",
77
"scripts": {
88
"start": "node server.js",
9-
"build:package": "cd ../../lib/msal-browser && npm run build:all",
9+
"build:package": "cd ../../../lib/msal-browser && npm run build:all",
1010
"start:build": "npm run build:package && npm start",
1111
"test:e2e": "ts-node ./e2eTests/testRunner.ts"
1212
},

samples/VanillaJSTestApp/server.js renamed to samples/msal-browser-samples/VanillaJSTestApp2.0/server.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ if (argv.p) {
3838
app.use(morgan('dev'));
3939

4040
// Set the front-end folder to serve public assets.
41-
app.use("/dist", express.static(path.join(__dirname, "../../lib/msal-core/dist")));
41+
app.use("/lib", express.static(path.join(__dirname, "../../../lib/msal-browser/lib")));
4242

4343
const sampleName = argv.sample;
4444
const isSample = sampleFolders.includes(sampleName);

samples/UnifiedCacheTestApp/server.js renamed to samples/msal-core-samples/UnifiedCacheTestApp/server.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ var port = 1530; // process.env.PORT || 8080;
1515
app.use(morgan('dev'));
1616

1717
// Set the front-end folder to serve public assets.
18-
app.use("/dist", express.static(path.join(__dirname, "../../lib/msal-core/dist")));
18+
app.use("/dist", express.static(path.join(__dirname, "../../../lib/msal-core/dist")));
1919
app.use('/adal', express.static(__dirname + '/adal'));
2020

2121
// Set up our one route to the index.html file.

samples/VanillaJSTestApp/Readme.md renamed to samples/msal-core-samples/VanillaJSTestApp/Readme.md

+2-2

samples/VanillaJSTestApp/e2eTests/testRunner.ts renamed to samples/msal-core-samples/VanillaJSTestApp/e2eTests/testRunner.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function runMochaTests(sampleIndex: number) {
5353
app.use(morgan('dev'));
5454

5555
// Set the front-end folder to serve public assets.
56-
app.use("/dist", express.static(path.join(PARENT_DIR, "../../lib/msal-core/dist")));
56+
app.use("/dist", express.static(path.join(PARENT_DIR, "../../../lib/msal-core/dist")));
5757

5858
let sampleName = sampleFolders[sampleIndex];
5959
const mocha = createMochaObject(sampleName);

samples/VanillaJSTestApp/package.json renamed to samples/msal-core-samples/VanillaJSTestApp/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"main": "server.js",
77
"scripts": {
88
"start": "node server.js",
9-
"build:package": "cd ../../lib/msal-core && npm run build",
9+
"build:package": "cd ../../../lib/msal-core && npm run build",
1010
"start:build": "npm run build:package && npm start",
1111
"test:e2e": "ts-node ./e2eTests/testRunner.ts"
1212
},

samples/VanillaJSTestApp2.0/server.js renamed to samples/msal-core-samples/VanillaJSTestApp/server.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ if (argv.p) {
3838
app.use(morgan('dev'));
3939

4040
// Set the front-end folder to serve public assets.
41-
app.use("/lib", express.static(path.join(__dirname, "../../lib/msal-browser/lib")));
41+
app.use("/dist", express.static(path.join(__dirname, "../../../lib/msal-core/dist")));
4242

4343
const sampleName = argv.sample;
4444
const isSample = sampleFolders.includes(sampleName);

0 commit comments

Comments
 (0)