Skip to content

Update sample folder structure #1855

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"packages": [
"lib/*",
"samples/*"
"samples/**/*"
],
"version": "independent",
"concurrency": 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This developer sample is used to run basic use cases for the MSAL library. You c
### Pre-requisites
- Ensure [all pre-requisites](../../lib/msal-browser/README.md#prerequisites) have been completed to run msal-browser.
- Install node.js if needed (https://nodejs.org/en/).
- Build the `msal-browser` project with instructions provided in the [`README.md`](../../lib/msal-browser/README.md) or using the command `npm run build:package`.
- Build the `msal-browser` project with instructions provided in the [`README.md`](../../../lib/msal-browser/README.md) or using the command `npm run build:package`.

### Configure the application
- Open `./app/<sample-name>/authConfig.js` in an editor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

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

<!-- adding Bootstrap 4 for UI components -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ function handleResponse(resp) {
if (resp !== null) {
username = resp.account.username;
showWelcomeMessage(resp.account);
getTokenRedirect(tokenRequest, resp.account);
} else {
// need to call getAccount here?
const currentAccounts = myMSALObj.getAllAccounts();
Expand All @@ -36,7 +35,6 @@ function handleResponse(resp) {
} else if (currentAccounts.length === 1) {
username = currentAccounts[0].username;
showWelcomeMessage(currentAccounts[0]);
getTokenRedirect(tokenRequest, currentAccounts[0]);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const msalConfig = {

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

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

<!-- adding Bootstrap 4 for UI components -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async function enterCredentials(page: puppeteer.Page, testName: string): Promise
await page.click("#idSIButton9");
}

describe.skip("Browser tests", function () {
describe("Browser tests", function () {
this.timeout(0);
this.retries(1);

Expand Down Expand Up @@ -81,7 +81,7 @@ describe.skip("Browser tests", function () {
await browser.close();
});

it.skip("Performs loginRedirect and acquires 2 tokens", async () => {
it("Performs loginRedirect and acquires 2 tokens", async () => {
const testName = "multipleResources";
// Home Page
await takeScreenshot(page, testName, `samplePageInit`);
Expand Down Expand Up @@ -110,6 +110,6 @@ describe.skip("Browser tests", function () {
await page.waitForSelector("#second-resource-div");
await takeScreenshot(page, testName, `secondToken`);
sessionStorage = await page.evaluate(() => Object.assign({}, window.sessionStorage));
expect(Object.keys(sessionStorage).length).to.be.eq(4);
expect(Object.keys(sessionStorage).length).to.be.eq(5);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

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

<!-- adding Bootstrap 4 for UI components -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

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

<!-- adding Bootstrap 4 for UI components -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function runMochaTests(sampleIndex: number) {
app.use(morgan('dev'));

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

let sampleName = sampleFolders[sampleIndex];
const mocha = createMochaObject(sampleName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"main": "server.js",
"scripts": {
"start": "node server.js",
"build:package": "cd ../../lib/msal-browser && npm run build:all",
"build:package": "cd ../../../lib/msal-browser && npm run build:all",
"start:build": "npm run build:package && npm start",
"test:e2e": "ts-node ./e2eTests/testRunner.ts"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if (argv.p) {
app.use(morgan('dev'));

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

const sampleName = argv.sample;
const isSample = sampleFolders.includes(sampleName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var port = 1530; // process.env.PORT || 8080;
app.use(morgan('dev'));

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

// Set up our one route to the index.html file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ This developer sample is used to run basic use cases for the MSAL library. You c
## How to run the sample:

### Pre-requisites
- Ensure [all pre-requisites](../../lib/msal-core/README.md#pre-requisites) have been completed to run msal-core.
- Ensure [all pre-requisites](../../../lib/msal-core/README.md#pre-requisites) have been completed to run msal-core.
- Install node.js if needed (https://nodejs.org/en/).
- Build the `msal-core` project with instructions provided in the [`README.md`](../../lib/msal-core/README.md) or using the command `npm run build:package`.
- Build the `msal-core` project with instructions provided in the [`README.md`](../../../lib/msal-core/README.md) or using the command `npm run build:package`.

### Configure the application
- Open `./app/<sample-name>/authConfig.js` in an editor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function runMochaTests(sampleIndex: number) {
app.use(morgan('dev'));

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

let sampleName = sampleFolders[sampleIndex];
const mocha = createMochaObject(sampleName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"main": "server.js",
"scripts": {
"start": "node server.js",
"build:package": "cd ../../lib/msal-core && npm run build",
"build:package": "cd ../../../lib/msal-core && npm run build",
"start:build": "npm run build:package && npm start",
"test:e2e": "ts-node ./e2eTests/testRunner.ts"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if (argv.p) {
app.use(morgan('dev'));

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

const sampleName = argv.sample;
const isSample = sampleFolders.includes(sampleName);
Expand Down
Loading