@sprucelabs/spruce-location-utils 1.9.19 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/esm/index-module.d.ts +1 -1
- package/build/esm/index-module.js +1 -1
- package/build/index-module.d.ts +1 -1
- package/build/index-module.js +3 -3
- package/package.json +1 -1
- package/build/esm/tests/utilities/organizationAssert.utility.d.ts +0 -15
- package/build/esm/tests/utilities/organizationAssert.utility.js +0 -53
- package/build/tests/utilities/organizationAssert.utility.d.ts +0 -15
- package/build/tests/utilities/organizationAssert.utility.js +0 -42
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as
|
|
1
|
+
export { default as organizationAssert } from './tests/utilities/organizationAssert';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as
|
|
1
|
+
export { default as organizationAssert } from './tests/utilities/organizationAssert.js';
|
package/build/index-module.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as
|
|
1
|
+
export { default as organizationAssert } from './tests/utilities/organizationAssert';
|
package/build/index-module.js
CHANGED
|
@@ -3,6 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
var
|
|
8
|
-
Object.defineProperty(exports, "
|
|
6
|
+
exports.organizationAssert = void 0;
|
|
7
|
+
var organizationAssert_1 = require("./tests/utilities/organizationAssert");
|
|
8
|
+
Object.defineProperty(exports, "organizationAssert", { enumerable: true, get: function () { return __importDefault(organizationAssert_1).default; } });
|
package/package.json
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { SkillViewController } from '@sprucelabs/heartwood-view-controllers';
|
|
2
|
-
import { OrganizationFixture, ViewFixture } from '@sprucelabs/spruce-test-fixtures';
|
|
3
|
-
declare const organizationAssertUtil: {
|
|
4
|
-
assertRedirectsToAddOrgIfNoOrgExists(options: {
|
|
5
|
-
viewFixture: ViewFixture;
|
|
6
|
-
vc: SkillViewController<any>;
|
|
7
|
-
didAddOrgRedirectDestination: string;
|
|
8
|
-
}): Promise<void>;
|
|
9
|
-
assertDoesNotRedirectToAddAOrgIfOrgExists(options: {
|
|
10
|
-
organizationFixture: OrganizationFixture;
|
|
11
|
-
vc: SkillViewController<any>;
|
|
12
|
-
viewFixture: ViewFixture;
|
|
13
|
-
}): Promise<void>;
|
|
14
|
-
};
|
|
15
|
-
export default organizationAssertUtil;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { vcAssertUtil, } from '@sprucelabs/heartwood-view-controllers';
|
|
11
|
-
import { TestRouter, } from '@sprucelabs/spruce-test-fixtures';
|
|
12
|
-
import { assert } from '@sprucelabs/test';
|
|
13
|
-
const organizationAssertUtil = {
|
|
14
|
-
assertRedirectsToAddOrgIfNoOrgExists(options) {
|
|
15
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
-
const { viewFixture, vc, didAddOrgRedirectDestination: redirectDestination, } = options;
|
|
17
|
-
TestRouter.setShouldThrowWhenRedirectingToBadSvc(false);
|
|
18
|
-
const router = viewFixture.getRouter();
|
|
19
|
-
yield vcAssertUtil.assertActionRedirects({
|
|
20
|
-
router,
|
|
21
|
-
action: () => viewFixture.load(vc),
|
|
22
|
-
destination: {
|
|
23
|
-
id: 'organization.add',
|
|
24
|
-
args: {
|
|
25
|
-
redirect: {
|
|
26
|
-
id: redirectDestination,
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
TestRouter.setShouldThrowWhenRedirectingToBadSvc(true);
|
|
32
|
-
});
|
|
33
|
-
},
|
|
34
|
-
assertDoesNotRedirectToAddAOrgIfOrgExists(options) {
|
|
35
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
const { organizationFixture, vc, viewFixture } = options;
|
|
37
|
-
const organization = yield organizationFixture.seedDemoOrganization({
|
|
38
|
-
name: 'Root view controller',
|
|
39
|
-
});
|
|
40
|
-
yield viewFixture.loginAsDemoPerson();
|
|
41
|
-
viewFixture.getScope().setCurrentOrganization(organization.id);
|
|
42
|
-
let wasHit = false;
|
|
43
|
-
yield viewFixture.getRouter().on('did-redirect', () => {
|
|
44
|
-
wasHit = true;
|
|
45
|
-
});
|
|
46
|
-
TestRouter.setShouldThrowWhenRedirectingToBadSvc(false);
|
|
47
|
-
yield viewFixture.load(vc);
|
|
48
|
-
TestRouter.setShouldThrowWhenRedirectingToBadSvc(true);
|
|
49
|
-
assert.isFalse(wasHit);
|
|
50
|
-
});
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
export default organizationAssertUtil;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { SkillViewController } from '@sprucelabs/heartwood-view-controllers';
|
|
2
|
-
import { OrganizationFixture, ViewFixture } from '@sprucelabs/spruce-test-fixtures';
|
|
3
|
-
declare const organizationAssertUtil: {
|
|
4
|
-
assertRedirectsToAddOrgIfNoOrgExists(options: {
|
|
5
|
-
viewFixture: ViewFixture;
|
|
6
|
-
vc: SkillViewController<any>;
|
|
7
|
-
didAddOrgRedirectDestination: string;
|
|
8
|
-
}): Promise<void>;
|
|
9
|
-
assertDoesNotRedirectToAddAOrgIfOrgExists(options: {
|
|
10
|
-
organizationFixture: OrganizationFixture;
|
|
11
|
-
vc: SkillViewController<any>;
|
|
12
|
-
viewFixture: ViewFixture;
|
|
13
|
-
}): Promise<void>;
|
|
14
|
-
};
|
|
15
|
-
export default organizationAssertUtil;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const heartwood_view_controllers_1 = require("@sprucelabs/heartwood-view-controllers");
|
|
4
|
-
const spruce_test_fixtures_1 = require("@sprucelabs/spruce-test-fixtures");
|
|
5
|
-
const test_1 = require("@sprucelabs/test");
|
|
6
|
-
const organizationAssertUtil = {
|
|
7
|
-
async assertRedirectsToAddOrgIfNoOrgExists(options) {
|
|
8
|
-
const { viewFixture, vc, didAddOrgRedirectDestination: redirectDestination, } = options;
|
|
9
|
-
spruce_test_fixtures_1.TestRouter.setShouldThrowWhenRedirectingToBadSvc(false);
|
|
10
|
-
const router = viewFixture.getRouter();
|
|
11
|
-
await heartwood_view_controllers_1.vcAssertUtil.assertActionRedirects({
|
|
12
|
-
router,
|
|
13
|
-
action: () => viewFixture.load(vc),
|
|
14
|
-
destination: {
|
|
15
|
-
id: 'organization.add',
|
|
16
|
-
args: {
|
|
17
|
-
redirect: {
|
|
18
|
-
id: redirectDestination,
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
});
|
|
23
|
-
spruce_test_fixtures_1.TestRouter.setShouldThrowWhenRedirectingToBadSvc(true);
|
|
24
|
-
},
|
|
25
|
-
async assertDoesNotRedirectToAddAOrgIfOrgExists(options) {
|
|
26
|
-
const { organizationFixture, vc, viewFixture } = options;
|
|
27
|
-
const organization = await organizationFixture.seedDemoOrganization({
|
|
28
|
-
name: 'Root view controller',
|
|
29
|
-
});
|
|
30
|
-
await viewFixture.loginAsDemoPerson();
|
|
31
|
-
viewFixture.getScope().setCurrentOrganization(organization.id);
|
|
32
|
-
let wasHit = false;
|
|
33
|
-
await viewFixture.getRouter().on('did-redirect', () => {
|
|
34
|
-
wasHit = true;
|
|
35
|
-
});
|
|
36
|
-
spruce_test_fixtures_1.TestRouter.setShouldThrowWhenRedirectingToBadSvc(false);
|
|
37
|
-
await viewFixture.load(vc);
|
|
38
|
-
spruce_test_fixtures_1.TestRouter.setShouldThrowWhenRedirectingToBadSvc(true);
|
|
39
|
-
test_1.assert.isFalse(wasHit);
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
exports.default = organizationAssertUtil;
|