New eslint rules auto fix (#3058)
* no-implicit-coercion and no-unneeded-ternary * End every line with a semicolon * Spacing and formatting * Enabled semi-spacing * Applies npm run lint:fix to code after master merge * Fix merge issues * Switched operator-linebreak to 'before' Co-authored-by: Joshi <simplyrender@gmail.com>
This commit is contained in:
@@ -31,7 +31,7 @@ define([
|
||||
) {
|
||||
|
||||
return {
|
||||
name:"platform/policy",
|
||||
name: "platform/policy",
|
||||
definition: {
|
||||
"name": "Policy Service",
|
||||
"description": "Provides support for extension-driven decisions.",
|
||||
|
||||
@@ -51,7 +51,6 @@ define(
|
||||
* @returns {boolean} false if disallowed; otherwise, true
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* The `policyService` handles decisions about what things
|
||||
* are and are not allowed in certain contexts.
|
||||
@@ -92,6 +91,7 @@ define(
|
||||
function instantiate(Policy) {
|
||||
var policy = Object.create(new Policy());
|
||||
policy.message = Policy.message;
|
||||
|
||||
return policy;
|
||||
}
|
||||
|
||||
@@ -128,6 +128,7 @@ define(
|
||||
if (callback) {
|
||||
callback(policyList[i].message);
|
||||
}
|
||||
|
||||
// And return the failed result.
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -34,18 +34,39 @@ define(
|
||||
|
||||
beforeEach(function () {
|
||||
testPolicies = [
|
||||
{ category: "a", message: "some message", result: true },
|
||||
{ category: "a", result: true },
|
||||
{ category: "a", result: true },
|
||||
{ category: "b", message: "some message", result: true },
|
||||
{ category: "b", result: true },
|
||||
{ category: "b", result: true }
|
||||
{
|
||||
category: "a",
|
||||
message: "some message",
|
||||
result: true
|
||||
},
|
||||
{
|
||||
category: "a",
|
||||
result: true
|
||||
},
|
||||
{
|
||||
category: "a",
|
||||
result: true
|
||||
},
|
||||
{
|
||||
category: "b",
|
||||
message: "some message",
|
||||
result: true
|
||||
},
|
||||
{
|
||||
category: "b",
|
||||
result: true
|
||||
},
|
||||
{
|
||||
category: "b",
|
||||
result: true
|
||||
}
|
||||
];
|
||||
mockPolicies = testPolicies.map(function (p) {
|
||||
var mockPolicy = jasmine.createSpyObj("policy", ['allow']);
|
||||
mockPolicy.allow.and.callFake(function () {
|
||||
return p.result;
|
||||
});
|
||||
|
||||
return mockPolicy;
|
||||
});
|
||||
mockPolicyConstructors = testPolicies.map(function (p, i) {
|
||||
@@ -53,6 +74,7 @@ define(
|
||||
mockPolicyConstructor.and.returnValue(mockPolicies[i]);
|
||||
mockPolicyConstructor.message = p.message;
|
||||
mockPolicyConstructor.category = p.category;
|
||||
|
||||
return mockPolicyConstructor;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user