@sprucelabs/spruce-location-utils 1.9.17 → 2.0.1
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/esm/tests/utilities/{organizationAssert.utility.d.ts → organizationAssert.d.ts} +4 -3
- package/build/esm/tests/utilities/{organizationAssert.utility.js → organizationAssert.js} +10 -9
- package/build/index-module.d.ts +1 -1
- package/build/index-module.js +3 -3
- package/build/tests/utilities/{organizationAssert.utility.d.ts → organizationAssert.d.ts} +4 -3
- package/build/tests/utilities/{organizationAssert.utility.js → organizationAssert.js} +10 -9
- package/package.json +27 -27
|
@@ -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/esm/tests/utilities/{organizationAssert.utility.d.ts → organizationAssert.d.ts}
RENAMED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { SkillViewController } from '@sprucelabs/heartwood-view-controllers';
|
|
2
2
|
import { OrganizationFixture, ViewFixture } from '@sprucelabs/spruce-test-fixtures';
|
|
3
|
-
declare const
|
|
3
|
+
declare const organizationAssert: {
|
|
4
4
|
assertRedirectsToAddOrgIfNoOrgExists(options: {
|
|
5
5
|
viewFixture: ViewFixture;
|
|
6
|
+
organizationFixture: OrganizationFixture;
|
|
6
7
|
vc: SkillViewController<any>;
|
|
7
8
|
didAddOrgRedirectDestination: string;
|
|
8
9
|
}): Promise<void>;
|
|
9
10
|
assertDoesNotRedirectToAddAOrgIfOrgExists(options: {
|
|
10
|
-
organizationFixture: OrganizationFixture;
|
|
11
11
|
vc: SkillViewController<any>;
|
|
12
12
|
viewFixture: ViewFixture;
|
|
13
|
+
organizationFixture: OrganizationFixture;
|
|
13
14
|
}): Promise<void>;
|
|
14
15
|
};
|
|
15
|
-
export default
|
|
16
|
+
export default organizationAssert;
|
|
@@ -10,10 +10,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { vcAssertUtil, } from '@sprucelabs/heartwood-view-controllers';
|
|
11
11
|
import { TestRouter, } from '@sprucelabs/spruce-test-fixtures';
|
|
12
12
|
import { assert } from '@sprucelabs/test';
|
|
13
|
-
const
|
|
13
|
+
const organizationAssert = {
|
|
14
14
|
assertRedirectsToAddOrgIfNoOrgExists(options) {
|
|
15
15
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
-
const { viewFixture, vc, didAddOrgRedirectDestination: redirectDestination, } = options;
|
|
16
|
+
const { viewFixture, vc, organizationFixture, didAddOrgRedirectDestination: redirectDestination, } = options;
|
|
17
|
+
yield organizationFixture.deleteAllOrganizations();
|
|
17
18
|
TestRouter.setShouldThrowWhenRedirectingToBadSvc(false);
|
|
18
19
|
const router = viewFixture.getRouter();
|
|
19
20
|
yield vcAssertUtil.assertActionRedirects({
|
|
@@ -33,12 +34,12 @@ const organizationAssertUtil = {
|
|
|
33
34
|
},
|
|
34
35
|
assertDoesNotRedirectToAddAOrgIfOrgExists(options) {
|
|
35
36
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
const {
|
|
37
|
-
const organization = yield organizationFixture.seedDemoOrganization({
|
|
38
|
-
name: 'Root view controller',
|
|
39
|
-
});
|
|
37
|
+
const { vc, viewFixture, organizationFixture } = options;
|
|
40
38
|
yield viewFixture.loginAsDemoPerson();
|
|
41
|
-
|
|
39
|
+
const latest = yield organizationFixture.getNewestOrganization();
|
|
40
|
+
if (!latest) {
|
|
41
|
+
yield organizationFixture.seedDemoOrganization();
|
|
42
|
+
}
|
|
42
43
|
let wasHit = false;
|
|
43
44
|
yield viewFixture.getRouter().on('did-redirect', () => {
|
|
44
45
|
wasHit = true;
|
|
@@ -46,8 +47,8 @@ const organizationAssertUtil = {
|
|
|
46
47
|
TestRouter.setShouldThrowWhenRedirectingToBadSvc(false);
|
|
47
48
|
yield viewFixture.load(vc);
|
|
48
49
|
TestRouter.setShouldThrowWhenRedirectingToBadSvc(true);
|
|
49
|
-
assert.isFalse(wasHit);
|
|
50
|
+
assert.isFalse(wasHit, `I was redirected and didn't expect to be.`);
|
|
50
51
|
});
|
|
51
52
|
},
|
|
52
53
|
};
|
|
53
|
-
export default
|
|
54
|
+
export default organizationAssert;
|
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; } });
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { SkillViewController } from '@sprucelabs/heartwood-view-controllers';
|
|
2
2
|
import { OrganizationFixture, ViewFixture } from '@sprucelabs/spruce-test-fixtures';
|
|
3
|
-
declare const
|
|
3
|
+
declare const organizationAssert: {
|
|
4
4
|
assertRedirectsToAddOrgIfNoOrgExists(options: {
|
|
5
5
|
viewFixture: ViewFixture;
|
|
6
|
+
organizationFixture: OrganizationFixture;
|
|
6
7
|
vc: SkillViewController<any>;
|
|
7
8
|
didAddOrgRedirectDestination: string;
|
|
8
9
|
}): Promise<void>;
|
|
9
10
|
assertDoesNotRedirectToAddAOrgIfOrgExists(options: {
|
|
10
|
-
organizationFixture: OrganizationFixture;
|
|
11
11
|
vc: SkillViewController<any>;
|
|
12
12
|
viewFixture: ViewFixture;
|
|
13
|
+
organizationFixture: OrganizationFixture;
|
|
13
14
|
}): Promise<void>;
|
|
14
15
|
};
|
|
15
|
-
export default
|
|
16
|
+
export default organizationAssert;
|
|
@@ -3,9 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const heartwood_view_controllers_1 = require("@sprucelabs/heartwood-view-controllers");
|
|
4
4
|
const spruce_test_fixtures_1 = require("@sprucelabs/spruce-test-fixtures");
|
|
5
5
|
const test_1 = require("@sprucelabs/test");
|
|
6
|
-
const
|
|
6
|
+
const organizationAssert = {
|
|
7
7
|
async assertRedirectsToAddOrgIfNoOrgExists(options) {
|
|
8
|
-
const { viewFixture, vc, didAddOrgRedirectDestination: redirectDestination, } = options;
|
|
8
|
+
const { viewFixture, vc, organizationFixture, didAddOrgRedirectDestination: redirectDestination, } = options;
|
|
9
|
+
await organizationFixture.deleteAllOrganizations();
|
|
9
10
|
spruce_test_fixtures_1.TestRouter.setShouldThrowWhenRedirectingToBadSvc(false);
|
|
10
11
|
const router = viewFixture.getRouter();
|
|
11
12
|
await heartwood_view_controllers_1.vcAssertUtil.assertActionRedirects({
|
|
@@ -23,12 +24,12 @@ const organizationAssertUtil = {
|
|
|
23
24
|
spruce_test_fixtures_1.TestRouter.setShouldThrowWhenRedirectingToBadSvc(true);
|
|
24
25
|
},
|
|
25
26
|
async assertDoesNotRedirectToAddAOrgIfOrgExists(options) {
|
|
26
|
-
const {
|
|
27
|
-
const organization = await organizationFixture.seedDemoOrganization({
|
|
28
|
-
name: 'Root view controller',
|
|
29
|
-
});
|
|
27
|
+
const { vc, viewFixture, organizationFixture } = options;
|
|
30
28
|
await viewFixture.loginAsDemoPerson();
|
|
31
|
-
|
|
29
|
+
const latest = await organizationFixture.getNewestOrganization();
|
|
30
|
+
if (!latest) {
|
|
31
|
+
await organizationFixture.seedDemoOrganization();
|
|
32
|
+
}
|
|
32
33
|
let wasHit = false;
|
|
33
34
|
await viewFixture.getRouter().on('did-redirect', () => {
|
|
34
35
|
wasHit = true;
|
|
@@ -36,7 +37,7 @@ const organizationAssertUtil = {
|
|
|
36
37
|
spruce_test_fixtures_1.TestRouter.setShouldThrowWhenRedirectingToBadSvc(false);
|
|
37
38
|
await viewFixture.load(vc);
|
|
38
39
|
spruce_test_fixtures_1.TestRouter.setShouldThrowWhenRedirectingToBadSvc(true);
|
|
39
|
-
test_1.assert.isFalse(wasHit);
|
|
40
|
+
test_1.assert.isFalse(wasHit, `I was redirected and didn't expect to be.`);
|
|
40
41
|
},
|
|
41
42
|
};
|
|
42
|
-
exports.default =
|
|
43
|
+
exports.default = organizationAssert;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sprucelabs/spruce-location-utils",
|
|
3
3
|
"description": "Locations",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.1",
|
|
5
5
|
"skill": {
|
|
6
6
|
"namespace": "locations"
|
|
7
7
|
},
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
"files": [
|
|
17
17
|
"build/index-module.js",
|
|
18
18
|
"build/index-module.d.ts",
|
|
19
|
-
"build/tests/utilities/organizationAssert.
|
|
20
|
-
"build/tests/utilities/organizationAssert.
|
|
19
|
+
"build/tests/utilities/organizationAssert.js",
|
|
20
|
+
"build/tests/utilities/organizationAssert.d.ts",
|
|
21
21
|
"build/esm/index-module.js",
|
|
22
22
|
"build/esm/index-module.d.ts",
|
|
23
|
-
"build/esm/tests/utilities/organizationAssert.
|
|
24
|
-
"build/esm/tests/utilities/organizationAssert.
|
|
23
|
+
"build/esm/tests/utilities/organizationAssert.js",
|
|
24
|
+
"build/esm/tests/utilities/organizationAssert.d.ts"
|
|
25
25
|
],
|
|
26
26
|
"keywords": [],
|
|
27
27
|
"scripts": {
|
|
@@ -56,37 +56,37 @@
|
|
|
56
56
|
"watch.tsc": "tsc -w"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@sprucelabs/error": "^5.0.
|
|
60
|
-
"@sprucelabs/heartwood-view-controllers": "^51.
|
|
61
|
-
"@sprucelabs/mercury-client": "^17.2.
|
|
62
|
-
"@sprucelabs/mercury-core-events": "^1.6.
|
|
63
|
-
"@sprucelabs/mercury-types": "^26.1.
|
|
64
|
-
"@sprucelabs/schema": "^25.4.
|
|
65
|
-
"@sprucelabs/spruce-core-schemas": "^22.6.
|
|
66
|
-
"@sprucelabs/spruce-event-plugin": "^
|
|
67
|
-
"@sprucelabs/spruce-event-utils": "^17.1.
|
|
68
|
-
"@sprucelabs/spruce-skill-booter": "^
|
|
69
|
-
"@sprucelabs/spruce-skill-utils": "^22.1.
|
|
70
|
-
"@sprucelabs/spruce-view-plugin": "^7.0.
|
|
59
|
+
"@sprucelabs/error": "^5.0.304",
|
|
60
|
+
"@sprucelabs/heartwood-view-controllers": "^51.4.1",
|
|
61
|
+
"@sprucelabs/mercury-client": "^17.2.8",
|
|
62
|
+
"@sprucelabs/mercury-core-events": "^1.6.150",
|
|
63
|
+
"@sprucelabs/mercury-types": "^26.1.941",
|
|
64
|
+
"@sprucelabs/schema": "^25.4.41",
|
|
65
|
+
"@sprucelabs/spruce-core-schemas": "^22.6.209",
|
|
66
|
+
"@sprucelabs/spruce-event-plugin": "^15.0.5",
|
|
67
|
+
"@sprucelabs/spruce-event-utils": "^17.1.214",
|
|
68
|
+
"@sprucelabs/spruce-skill-booter": "^15.0.5",
|
|
69
|
+
"@sprucelabs/spruce-skill-utils": "^22.1.20",
|
|
70
|
+
"@sprucelabs/spruce-view-plugin": "^7.0.250",
|
|
71
71
|
"dotenv": "^10.0.0",
|
|
72
72
|
"globby": "^11.0.4"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@sprucelabs/esm-postbuild": "^1.0.
|
|
76
|
-
"@sprucelabs/jest-json-reporter": "^6.0.
|
|
77
|
-
"@sprucelabs/jest-sheets-reporter": "^1.2.
|
|
78
|
-
"@sprucelabs/resolve-path-aliases": "^1.0.
|
|
75
|
+
"@sprucelabs/esm-postbuild": "^1.0.292",
|
|
76
|
+
"@sprucelabs/jest-json-reporter": "^6.0.257",
|
|
77
|
+
"@sprucelabs/jest-sheets-reporter": "^1.2.262",
|
|
78
|
+
"@sprucelabs/resolve-path-aliases": "^1.0.232",
|
|
79
79
|
"@sprucelabs/semantic-release": "^4.0.8",
|
|
80
|
-
"@sprucelabs/spruce-test-fixtures": "^
|
|
81
|
-
"@sprucelabs/test": "^7.7.
|
|
82
|
-
"@sprucelabs/test-utils": "^3.0.
|
|
83
|
-
"@types/node": "^16.11.
|
|
80
|
+
"@sprucelabs/spruce-test-fixtures": "^15.0.5",
|
|
81
|
+
"@sprucelabs/test": "^7.7.240",
|
|
82
|
+
"@sprucelabs/test-utils": "^3.0.287",
|
|
83
|
+
"@types/node": "^16.11.11",
|
|
84
84
|
"chokidar-cli": "^3.0.0",
|
|
85
85
|
"concurrently": "^6.4.0",
|
|
86
86
|
"eslint": "^8.3.0",
|
|
87
87
|
"eslint-config-spruce": "^10.10.16",
|
|
88
|
-
"jest": "^27.
|
|
89
|
-
"jest-circus": "^27.
|
|
88
|
+
"jest": "^27.4.2",
|
|
89
|
+
"jest-circus": "^27.4.2",
|
|
90
90
|
"prettier": "^2.5.0",
|
|
91
91
|
"ts-node": "^10.4.0",
|
|
92
92
|
"tsc-watch": "^4.5.0",
|