Skip to content

Commit 4172e33

Browse files
satisfy project lint rules
1 parent 9b1a614 commit 4172e33

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

src/core/oauth2-authorize.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ export default function authorize ( { auth, authActions, errActions, configs, au
6464
}
6565
}
6666

67-
let authorizationUrl = schema.get("authorizationUrl");
68-
let url = [authorizationUrl, query.join("&")].join(authorizationUrl.indexOf('?') === -1 ? "?" : "&")
67+
let authorizationUrl = schema.get("authorizationUrl")
68+
let url = [authorizationUrl, query.join("&")].join(authorizationUrl.indexOf("?") === -1 ? "?" : "&")
6969

7070
// pass action authorizeOauth2 and authentication data through window
7171
// to authorize with oauth2

test/core/oauth2-authorize.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,33 @@ import oauth2Authorize from "core/oauth2-authorize"
77
describe("OAuth2", function () {
88

99
let mockSchema = {
10-
flow: 'accessCode',
11-
authorizationUrl: 'https://testAuthorizationUrl'
12-
};
10+
flow: "accessCode",
11+
authorizationUrl: "https://testAuthorizationUrl"
12+
}
1313

1414
let authConfig = {
1515
auth: { schema: { get: (key)=> mockSchema[key] } },
1616
authActions: {},
1717
errActions: {},
1818
configs: { oauth2RedirectUrl: "" },
1919
authConfigs: {}
20-
};
20+
}
2121

2222
describe("authorize redirect", function () {
2323

2424
it("should build redirectUrl", function() {
25-
win.open = createSpy();
26-
oauth2Authorize(authConfig);
27-
expect(win.open.calls.length).toEqual(1);
28-
expect(win.open.calls[0].arguments[0]).toMatch("https://testAuthorizationUrl?response_type=code&redirect_uri=&state=");
29-
});
25+
win.open = createSpy()
26+
oauth2Authorize(authConfig)
27+
expect(win.open.calls.length).toEqual(1)
28+
expect(win.open.calls[0].arguments[0]).toMatch("https://testAuthorizationUrl?response_type=code&redirect_uri=&state=")
29+
})
3030

3131
it("should build correct redirectUrl from authorizeUrl with query parameters", function() {
32-
win.open = createSpy();
33-
mockSchema.authorizationUrl = 'https://testAuthorizationUrl?param=1';
34-
oauth2Authorize(authConfig);
35-
expect(win.open.calls.length).toEqual(1);
36-
expect(win.open.calls[0].arguments[0]).toMatch("https://testAuthorizationUrl?param=1&response_type=code&redirect_uri=&state=");
37-
});
38-
});
39-
});
32+
win.open = createSpy()
33+
mockSchema.authorizationUrl = "https://testAuthorizationUrl?param=1"
34+
oauth2Authorize(authConfig)
35+
expect(win.open.calls.length).toEqual(1)
36+
expect(win.open.calls[0].arguments[0]).toMatch("https://testAuthorizationUrl?param=1&response_type=code&redirect_uri=&state=")
37+
})
38+
})
39+
})

0 commit comments

Comments
 (0)