@sprucelabs/spruce-test-fixtures 49.0.40 → 49.0.41
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/__tests__/behavioral/CanUseStoresSetupInBeforeEach.test.js +5 -5
- package/build/__tests__/behavioral/DatabaseFixture.test.d.ts +1 -1
- package/build/__tests__/behavioral/DatabaseFixture.test.js +7 -7
- package/build/__tests__/behavioral/DbResetsAsExpected.test.js +4 -4
- package/build/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.js +18 -18
- package/build/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.js +3 -3
- package/build/__tests__/behavioral/DisablingSchemaValidationOnTest.test.js +5 -5
- package/build/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.js +9 -9
- package/build/__tests__/behavioral/FakingEventResponses.test.js +15 -15
- package/build/__tests__/behavioral/FixtureFactory.test.d.ts +1 -1
- package/build/__tests__/behavioral/FixtureFactory.test.js +14 -14
- package/build/__tests__/behavioral/LocationFixture.test.js +17 -17
- package/build/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.js +11 -11
- package/build/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.js +3 -3
- package/build/__tests__/behavioral/MercuryFixture.test.js +28 -28
- package/build/__tests__/behavioral/OrganizationFixture.test.js +50 -50
- package/build/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.js +3 -3
- package/build/__tests__/behavioral/PersonFixture.test.d.ts +1 -1
- package/build/__tests__/behavioral/PersonFixture.test.js +37 -37
- package/build/__tests__/behavioral/PhoneNumberIncrementor.test.js +22 -22
- package/build/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.js +5 -5
- package/build/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.js +3 -3
- package/build/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.js +5 -5
- package/build/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.js +9 -9
- package/build/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.js +4 -4
- package/build/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.js +2 -2
- package/build/__tests__/behavioral/RoleFixture.test.js +15 -15
- package/build/__tests__/behavioral/SeedingData.test.js +43 -43
- package/build/__tests__/behavioral/SkillFixture.test.js +22 -22
- package/build/__tests__/behavioral/StoreFixture.test.d.ts +1 -1
- package/build/__tests__/behavioral/StoreFixture.test.js +20 -20
- package/build/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.js +11 -11
- package/build/__tests__/behavioral/faking/FakeDecorator.test.js +74 -74
- package/build/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.js +3 -3
- package/build/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.js +3 -3
- package/build/__tests__/behavioral/faking/FakeThemeManager.test.d.ts +1 -1
- package/build/__tests__/behavioral/faking/FakeThemeManager.test.js +8 -8
- package/build/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.js +6 -6
- package/build/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.js +15 -15
- package/build/__tests__/behavioral/faking/FakingAuthenticator.test.js +5 -5
- package/build/__tests__/behavioral/faking/FakingInBeforeEach.test.js +5 -5
- package/build/__tests__/behavioral/faking/FakingRoleEvents.test.js +19 -19
- package/build/__tests__/behavioral/faking/FakingSkillEvents.test.js +41 -41
- package/build/__tests__/behavioral/faking/UpdatePerson.test.js +5 -5
- package/build/__tests__/behavioral/faking/UsingFakeDecorators.test.js +60 -60
- package/build/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.d.ts +1 -1
- package/build/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.js +4 -4
- package/build/__tests__/behavioral/faking/WhoAmI.test.js +12 -12
- package/build/__tests__/behavioral/maps/SpyingMapUtil.test.js +17 -17
- package/build/__tests__/behavioral/seeding/UsingDecorators.test.js +54 -54
- package/build/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.js +16 -16
- package/build/__tests__/behavioral/views/CheckingPermissions.test.js +30 -30
- package/build/__tests__/behavioral/views/FakingSkillViewControllers.test.js +8 -8
- package/build/__tests__/behavioral/views/Routing.test.js +30 -30
- package/build/__tests__/behavioral/views/TestingScope.test.js +10 -10
- package/build/__tests__/behavioral/views/ViewFixture.test.js +107 -107
- package/build/__tests__/behavioral/views/WorkingWithTimezones.test.js +10 -10
- package/build/__tests__/support/AbstractFakeDecoratorTest.js +4 -4
- package/build/esm/__tests__/behavioral/CanUseStoresSetupInBeforeEach.test.js +1 -1
- package/build/esm/__tests__/behavioral/DatabaseFixture.test.d.ts +1 -1
- package/build/esm/__tests__/behavioral/DatabaseFixture.test.js +1 -1
- package/build/esm/__tests__/behavioral/DbResetsAsExpected.test.js +1 -1
- package/build/esm/__tests__/behavioral/DecoratoringEmitToPassThroughProxy.test.js +1 -1
- package/build/esm/__tests__/behavioral/DelaysConnectWhenOnlyUsingLoginDecorator.test.js +1 -1
- package/build/esm/__tests__/behavioral/DisablingSchemaValidationOnTest.test.js +1 -1
- package/build/esm/__tests__/behavioral/DoesntResetAccountIfOnlySeedingLocally.test.js +1 -1
- package/build/esm/__tests__/behavioral/FakingEventResponses.test.js +1 -1
- package/build/esm/__tests__/behavioral/FixtureFactory.test.d.ts +1 -1
- package/build/esm/__tests__/behavioral/FixtureFactory.test.js +1 -1
- package/build/esm/__tests__/behavioral/LocationFixture.test.js +1 -1
- package/build/esm/__tests__/behavioral/LoginDecoratorHandlingProxiesForMe.test.js +1 -1
- package/build/esm/__tests__/behavioral/MakingSureLocalEventsAreHandledLocally.test.js +1 -1
- package/build/esm/__tests__/behavioral/MercuryFixture.test.js +1 -1
- package/build/esm/__tests__/behavioral/OrganizationFixture.test.js +1 -1
- package/build/esm/__tests__/behavioral/PatchingConsoleErrorToErrorStream.test.js +1 -1
- package/build/esm/__tests__/behavioral/PersonFixture.test.d.ts +1 -1
- package/build/esm/__tests__/behavioral/PersonFixture.test.js +1 -1
- package/build/esm/__tests__/behavioral/PhoneNumberIncrementor.test.js +1 -1
- package/build/esm/__tests__/behavioral/ResettingAccountLocationsInBeforeAll.test.js +1 -1
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInAfterAll.test.js +1 -1
- package/build/esm/__tests__/behavioral/ResettingAccountOrgsInBeforeAll.test.js +1 -1
- package/build/esm/__tests__/behavioral/ResettingFixtureFieldsBeforeEach.test.js +1 -1
- package/build/esm/__tests__/behavioral/ResettingLocalEventListeningBeforeSeeding.test.js +1 -1
- package/build/esm/__tests__/behavioral/RetainsContractWhenLoggingInUsingDecotorator.test.js +1 -1
- package/build/esm/__tests__/behavioral/RoleFixture.test.js +1 -1
- package/build/esm/__tests__/behavioral/SeedingData.test.js +1 -1
- package/build/esm/__tests__/behavioral/SkillFixture.test.js +1 -1
- package/build/esm/__tests__/behavioral/StoreFixture.test.d.ts +1 -1
- package/build/esm/__tests__/behavioral/StoreFixture.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/AuthenticatingAsAPerson.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/FakeDecorator.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/FakeDecoratorSetsPerson.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/FakeDecoratorWhoAmI.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/FakeThemeManager.test.d.ts +1 -1
- package/build/esm/__tests__/behavioral/faking/FakeThemeManager.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToALocation.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/FakingAddingPeopleToAnOrg.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/FakingAuthenticator.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/FakingInBeforeEach.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/FakingRoleEvents.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/FakingSkillEvents.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/UpdatePerson.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/UsingFakeDecorators.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.d.ts +1 -1
- package/build/esm/__tests__/behavioral/faking/UsingFakesOnIncompatibleClass.test.js +1 -1
- package/build/esm/__tests__/behavioral/faking/WhoAmI.test.js +1 -1
- package/build/esm/__tests__/behavioral/maps/SpyingMapUtil.test.js +1 -1
- package/build/esm/__tests__/behavioral/seeding/UsingDecorators.test.js +1 -1
- package/build/esm/__tests__/behavioral/seeding/UsingDecoratorsToInstallSkills.test.js +1 -1
- package/build/esm/__tests__/behavioral/views/CheckingPermissions.test.js +1 -1
- package/build/esm/__tests__/behavioral/views/FakingSkillViewControllers.test.js +1 -1
- package/build/esm/__tests__/behavioral/views/Routing.test.js +1 -1
- package/build/esm/__tests__/behavioral/views/TestingScope.test.js +1 -1
- package/build/esm/__tests__/behavioral/views/ViewFixture.test.js +1 -1
- package/build/esm/__tests__/behavioral/views/WorkingWithTimezones.test.js +1 -1
- package/build/esm/__tests__/support/AbstractFakeDecoratorTest.js +1 -1
- package/build/esm/tests/AbstractSpruceFixtureTest.js +1 -1
- package/build/esm/tests/SpyAuthorizer.js +1 -1
- package/build/esm/tests/decorators/fake.js +1 -1
- package/build/esm/tests/decorators/install.js +1 -1
- package/build/esm/tests/decorators/login.js +1 -1
- package/build/esm/tests/decorators/seed.js +1 -1
- package/build/esm/tests/fixtures/LocationFixture.js +1 -1
- package/build/esm/tests/fixtures/RoleFixture.js +1 -1
- package/build/esm/tests/fixtures/SeedFixture.js +1 -1
- package/build/tests/AbstractSpruceFixtureTest.js +3 -3
- package/build/tests/SpyAuthorizer.js +3 -3
- package/build/tests/decorators/fake.js +20 -20
- package/build/tests/decorators/install.js +3 -3
- package/build/tests/decorators/login.js +4 -4
- package/build/tests/decorators/seed.js +2 -2
- package/build/tests/fixtures/LocationFixture.js +3 -3
- package/build/tests/fixtures/RoleFixture.js +2 -2
- package/build/tests/fixtures/SeedFixture.js +2 -2
- package/package.json +4 -4
|
@@ -9,7 +9,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const
|
|
12
|
+
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
13
13
|
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../tests/AbstractSpruceFixtureTest"));
|
|
14
14
|
const seed_1 = __importDefault(require("../../tests/decorators/seed"));
|
|
15
15
|
const StoreFixture_1 = __importDefault(require("../../tests/fixtures/StoreFixture"));
|
|
@@ -22,19 +22,19 @@ class CanUseStoresSetupInBeforeEachTest extends AbstractSpruceFixtureTest_1.defa
|
|
|
22
22
|
}
|
|
23
23
|
static async shouldNotLoseData() {
|
|
24
24
|
const count = await this.goodStore.count({});
|
|
25
|
-
|
|
25
|
+
test_utils_1.assert.isEqual(count, 3);
|
|
26
26
|
}
|
|
27
27
|
static async shouldNotLoseData2() {
|
|
28
28
|
const count = await this.goodStore.count({});
|
|
29
|
-
|
|
29
|
+
test_utils_1.assert.isEqual(count, 10);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
__decorate([
|
|
33
|
-
(0,
|
|
33
|
+
(0, test_utils_1.test)(),
|
|
34
34
|
(0, seed_1.default)('good', 3)
|
|
35
35
|
], CanUseStoresSetupInBeforeEachTest, "shouldNotLoseData", null);
|
|
36
36
|
__decorate([
|
|
37
|
-
(0,
|
|
37
|
+
(0, test_utils_1.test)(),
|
|
38
38
|
(0, seed_1.default)('good', 10)
|
|
39
39
|
], CanUseStoresSetupInBeforeEachTest, "shouldNotLoseData2", null);
|
|
40
40
|
exports.default = CanUseStoresSetupInBeforeEachTest;
|
|
@@ -33,27 +33,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
35
|
const data_stores_1 = require("@sprucelabs/data-stores");
|
|
36
|
-
const
|
|
36
|
+
const test_utils_1 = __importStar(require("@sprucelabs/test-utils"));
|
|
37
37
|
const FixtureFactory_1 = __importDefault(require("../../tests/fixtures/FixtureFactory"));
|
|
38
|
-
class StoreFixtureTest extends
|
|
38
|
+
class StoreFixtureTest extends test_utils_1.default {
|
|
39
39
|
static async beforeEach() {
|
|
40
40
|
await super.beforeEach();
|
|
41
41
|
this.fixture = new FixtureFactory_1.default({ cwd: this.cwd }).Fixture('database');
|
|
42
42
|
}
|
|
43
43
|
static async canGetDatabaseFixture() {
|
|
44
|
-
|
|
44
|
+
test_utils_1.assert.isTruthy(this.fixture);
|
|
45
45
|
}
|
|
46
46
|
static async canConnectToDabatase() {
|
|
47
47
|
const db = await this.fixture.connectToDatabase();
|
|
48
|
-
|
|
48
|
+
test_utils_1.assert.isTrue(db.isConnected());
|
|
49
49
|
await data_stores_1.DatabaseFixture.destroy();
|
|
50
|
-
|
|
50
|
+
test_utils_1.assert.isFalse(db.isConnected());
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
__decorate([
|
|
54
|
-
(0,
|
|
54
|
+
(0, test_utils_1.test)()
|
|
55
55
|
], StoreFixtureTest, "canGetDatabaseFixture", null);
|
|
56
56
|
__decorate([
|
|
57
|
-
(0,
|
|
57
|
+
(0, test_utils_1.test)()
|
|
58
58
|
], StoreFixtureTest, "canConnectToDabatase", null);
|
|
59
59
|
exports.default = StoreFixtureTest;
|
|
@@ -9,7 +9,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const
|
|
12
|
+
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
13
13
|
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../tests/AbstractSpruceFixtureTest"));
|
|
14
14
|
const seed_1 = __importDefault(require("../../tests/decorators/seed"));
|
|
15
15
|
const StoreFixture_1 = __importDefault(require("../../tests/fixtures/StoreFixture"));
|
|
@@ -19,13 +19,13 @@ const Good_store_1 = __importDefault(require("../testDirsAndFiles/one-good-store
|
|
|
19
19
|
//seed is called
|
|
20
20
|
class DbResetsAsExpectedTest extends AbstractSpruceFixtureTest_1.default {
|
|
21
21
|
static shouldBeReset() {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
test_utils_1.assert.isEqual(process.env.DB_NAME, 'memory');
|
|
23
|
+
test_utils_1.assert.isEqual(process.env.DB_CONNECTION_STRING, 'memory://');
|
|
24
24
|
}
|
|
25
25
|
static doesNothing() { }
|
|
26
26
|
}
|
|
27
27
|
__decorate([
|
|
28
|
-
(0,
|
|
28
|
+
(0, test_utils_1.test)()
|
|
29
29
|
], DbResetsAsExpectedTest, "shouldBeReset", null);
|
|
30
30
|
__decorate([
|
|
31
31
|
(0, seed_1.default)('good', 1)
|
|
@@ -9,25 +9,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const
|
|
12
|
+
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
13
13
|
const __1 = require("../..");
|
|
14
14
|
const ClientProxyDecorator_1 = __importDefault(require("../../ClientProxyDecorator"));
|
|
15
15
|
const constants_1 = require("../../tests/constants");
|
|
16
16
|
let DecoratingEmitToPassThroughProxyTest = class DecoratingEmitToPassThroughProxyTest extends __1.AbstractSpruceFixtureTest {
|
|
17
17
|
static sharesInstance() {
|
|
18
18
|
const instance = this.getDecorator();
|
|
19
|
-
|
|
19
|
+
test_utils_1.assert.isEqual(instance, ClientProxyDecorator_1.default.getInstance());
|
|
20
20
|
}
|
|
21
21
|
static canClearInstance() {
|
|
22
22
|
const instance = this.getDecorator();
|
|
23
23
|
ClientProxyDecorator_1.default.clearInstance();
|
|
24
|
-
|
|
24
|
+
test_utils_1.assert.isNotEqual(instance, this.getDecorator());
|
|
25
25
|
}
|
|
26
26
|
static canGetAndSetProxyGenerator() {
|
|
27
27
|
const instance = this.getDecorator();
|
|
28
28
|
const cb = async () => '12345';
|
|
29
29
|
instance.setProxyTokenGenerator(cb);
|
|
30
|
-
|
|
30
|
+
test_utils_1.assert.isEqual(instance.getProxyTokenGenerator(), cb);
|
|
31
31
|
}
|
|
32
32
|
static async canSetDefaultProxyPassThrough(id) {
|
|
33
33
|
const instance = this.getDecorator();
|
|
@@ -51,14 +51,14 @@ let DecoratingEmitToPassThroughProxyTest = class DecoratingEmitToPassThroughProx
|
|
|
51
51
|
client[key] = props;
|
|
52
52
|
const decorated = instance.decorateEmitToPassProxyToken(client);
|
|
53
53
|
//@ts-ignore
|
|
54
|
-
|
|
54
|
+
test_utils_1.assert.isEqualDeep(decorated[key], props);
|
|
55
55
|
}
|
|
56
56
|
static async instanceIsSameEachTest() {
|
|
57
|
-
|
|
57
|
+
test_utils_1.assert.isEqual(this.lastInstance, this.getDecorator());
|
|
58
58
|
}
|
|
59
59
|
static async loginSetsUpProxyTokenGenerator() {
|
|
60
60
|
const generator = this.getDecorator().getProxyTokenGenerator();
|
|
61
|
-
|
|
61
|
+
test_utils_1.assert.isTruthy(generator);
|
|
62
62
|
}
|
|
63
63
|
static async assertProxyEquals(client, id) {
|
|
64
64
|
let passedSource;
|
|
@@ -70,38 +70,38 @@ let DecoratingEmitToPassThroughProxyTest = class DecoratingEmitToPassThroughProx
|
|
|
70
70
|
};
|
|
71
71
|
});
|
|
72
72
|
await client.emit('whoami::v2020_12_25');
|
|
73
|
-
|
|
73
|
+
test_utils_1.assert.isEqual(passedSource.proxyToken, id);
|
|
74
74
|
await client.emitAndFlattenResponses('whoami::v2020_12_25');
|
|
75
|
-
|
|
75
|
+
test_utils_1.assert.isEqual(passedSource.proxyToken, id);
|
|
76
76
|
}
|
|
77
77
|
static getDecorator() {
|
|
78
78
|
return ClientProxyDecorator_1.default.getInstance();
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
81
|
__decorate([
|
|
82
|
-
(0,
|
|
82
|
+
(0, test_utils_1.test)()
|
|
83
83
|
], DecoratingEmitToPassThroughProxyTest, "sharesInstance", null);
|
|
84
84
|
__decorate([
|
|
85
|
-
(0,
|
|
85
|
+
(0, test_utils_1.test)()
|
|
86
86
|
], DecoratingEmitToPassThroughProxyTest, "canClearInstance", null);
|
|
87
87
|
__decorate([
|
|
88
|
-
(0,
|
|
88
|
+
(0, test_utils_1.test)()
|
|
89
89
|
], DecoratingEmitToPassThroughProxyTest, "canGetAndSetProxyGenerator", null);
|
|
90
90
|
__decorate([
|
|
91
|
-
(0,
|
|
92
|
-
(0,
|
|
91
|
+
(0, test_utils_1.test)('can set token to 234', '234'),
|
|
92
|
+
(0, test_utils_1.test)('can set token to waka', 'waka')
|
|
93
93
|
], DecoratingEmitToPassThroughProxyTest, "canSetDefaultProxyPassThrough", null);
|
|
94
94
|
__decorate([
|
|
95
|
-
(0,
|
|
95
|
+
(0, test_utils_1.test)()
|
|
96
96
|
], DecoratingEmitToPassThroughProxyTest, "canSetTokenWhileDecorating", null);
|
|
97
97
|
__decorate([
|
|
98
|
-
(0,
|
|
98
|
+
(0, test_utils_1.test)()
|
|
99
99
|
], DecoratingEmitToPassThroughProxyTest, "decoratorPassProps", null);
|
|
100
100
|
__decorate([
|
|
101
|
-
(0,
|
|
101
|
+
(0, test_utils_1.test)()
|
|
102
102
|
], DecoratingEmitToPassThroughProxyTest, "instanceIsSameEachTest", null);
|
|
103
103
|
__decorate([
|
|
104
|
-
(0,
|
|
104
|
+
(0, test_utils_1.test)()
|
|
105
105
|
], DecoratingEmitToPassThroughProxyTest, "loginSetsUpProxyTokenGenerator", null);
|
|
106
106
|
DecoratingEmitToPassThroughProxyTest = __decorate([
|
|
107
107
|
(0, __1.login)(constants_1.DEMO_NUMBER)
|
|
@@ -10,7 +10,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const mercury_client_1 = require("@sprucelabs/mercury-client");
|
|
13
|
-
const
|
|
13
|
+
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
14
14
|
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../tests/AbstractSpruceFixtureTest"));
|
|
15
15
|
const constants_1 = require("../../tests/constants");
|
|
16
16
|
const fake_1 = __importDefault(require("../../tests/decorators/fake"));
|
|
@@ -22,11 +22,11 @@ let DelaysConnectWhenOnlyUsingLoginDecoratorTest = class DelaysConnectWhenOnlyUs
|
|
|
22
22
|
eventSignatures: {},
|
|
23
23
|
});
|
|
24
24
|
//@ts-ignore
|
|
25
|
-
|
|
25
|
+
test_utils_1.assert.isTruthy(emitter.listenersByEvent['authenticate::v2020_12_25']);
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
__decorate([
|
|
29
|
-
(0,
|
|
29
|
+
(0, test_utils_1.test)()
|
|
30
30
|
], DelaysConnectWhenOnlyUsingLoginDecoratorTest, "globalEmitterListeningToAuthenticate", null);
|
|
31
31
|
DelaysConnectWhenOnlyUsingLoginDecoratorTest = __decorate([
|
|
32
32
|
fake_1.default.login(constants_1.DEMO_NUMBER)
|
|
@@ -6,21 +6,21 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
const
|
|
9
|
+
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
10
10
|
const __1 = require("../..");
|
|
11
11
|
class DisablingSchemaValidationOnTestTest extends __1.AbstractSpruceFixtureTest {
|
|
12
12
|
static shouldValidateIsFalse() {
|
|
13
|
-
|
|
13
|
+
test_utils_1.assert.isEqual(process.env.SHOULD_VALIDATE_SCHEMAS_ON_BOOT, 'false');
|
|
14
14
|
process.env.SHOULD_VALIDATE_SCHEMAS_ON_BOOT = 'true';
|
|
15
15
|
}
|
|
16
16
|
static revertsBeforeEachTest() {
|
|
17
|
-
|
|
17
|
+
test_utils_1.assert.isEqual(process.env.SHOULD_VALIDATE_SCHEMAS_ON_BOOT, 'false');
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
__decorate([
|
|
21
|
-
(0,
|
|
21
|
+
(0, test_utils_1.test)()
|
|
22
22
|
], DisablingSchemaValidationOnTestTest, "shouldValidateIsFalse", null);
|
|
23
23
|
__decorate([
|
|
24
|
-
(0,
|
|
24
|
+
(0, test_utils_1.test)()
|
|
25
25
|
], DisablingSchemaValidationOnTestTest, "revertsBeforeEachTest", null);
|
|
26
26
|
exports.default = DisablingSchemaValidationOnTestTest;
|
|
@@ -11,7 +11,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const mercury_client_1 = require("@sprucelabs/mercury-client");
|
|
13
13
|
const mercury_core_events_1 = require("@sprucelabs/mercury-core-events");
|
|
14
|
-
const
|
|
14
|
+
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
15
15
|
const __1 = require("../..");
|
|
16
16
|
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../tests/AbstractSpruceFixtureTest"));
|
|
17
17
|
const constants_1 = require("../../tests/constants");
|
|
@@ -32,31 +32,31 @@ let DoesntResetAccountIfOnlySeedingLocally = class DoesntResetAccountIfOnlySeedi
|
|
|
32
32
|
await super.beforeEach();
|
|
33
33
|
}
|
|
34
34
|
static doesNotResetAccount() {
|
|
35
|
-
|
|
35
|
+
test_utils_1.assert.isEqual(hitCount, 1);
|
|
36
36
|
}
|
|
37
37
|
static async doesNotResetBefore() {
|
|
38
|
-
|
|
38
|
+
test_utils_1.assert.isEqual(hitCount, 1);
|
|
39
39
|
}
|
|
40
40
|
static resetAfterSeedingOrgs() {
|
|
41
|
-
|
|
41
|
+
test_utils_1.assert.isEqual(hitCount, 2);
|
|
42
42
|
}
|
|
43
43
|
static shouldNotHaveHit() {
|
|
44
|
-
|
|
44
|
+
test_utils_1.assert.isEqual(hitCount, 2);
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
__decorate([
|
|
48
|
-
(0,
|
|
48
|
+
(0, test_utils_1.test)(),
|
|
49
49
|
(0, __1.seed)('good', 5)
|
|
50
50
|
], DoesntResetAccountIfOnlySeedingLocally, "doesNotResetAccount", null);
|
|
51
51
|
__decorate([
|
|
52
|
-
(0,
|
|
52
|
+
(0, test_utils_1.test)(),
|
|
53
53
|
(0, __1.seed)('organizations', 1)
|
|
54
54
|
], DoesntResetAccountIfOnlySeedingLocally, "doesNotResetBefore", null);
|
|
55
55
|
__decorate([
|
|
56
|
-
(0,
|
|
56
|
+
(0, test_utils_1.test)()
|
|
57
57
|
], DoesntResetAccountIfOnlySeedingLocally, "resetAfterSeedingOrgs", null);
|
|
58
58
|
__decorate([
|
|
59
|
-
(0,
|
|
59
|
+
(0, test_utils_1.test)()
|
|
60
60
|
], DoesntResetAccountIfOnlySeedingLocally, "shouldNotHaveHit", null);
|
|
61
61
|
DoesntResetAccountIfOnlySeedingLocally = __decorate([
|
|
62
62
|
(0, __1.login)(constants_1.DEMO_NUMBER_ACCOUNT_RESET)
|
|
@@ -10,7 +10,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const spruce_event_utils_1 = require("@sprucelabs/spruce-event-utils");
|
|
13
|
-
const
|
|
13
|
+
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
14
14
|
const __1 = require("../..");
|
|
15
15
|
const SpruceError_1 = __importDefault(require("../../errors/SpruceError"));
|
|
16
16
|
const eventFaker_1 = __importDefault(require("../../tests/eventFaker"));
|
|
@@ -43,10 +43,10 @@ class FakingErrorResponsesTest extends __1.AbstractSpruceFixtureTest {
|
|
|
43
43
|
type: 'anonymous',
|
|
44
44
|
};
|
|
45
45
|
});
|
|
46
|
-
|
|
46
|
+
test_utils_1.assert.isFalse(wasNewHit);
|
|
47
47
|
await this.client.emit(fqen);
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
test_utils_1.assert.isFalse(wasOldHit);
|
|
49
|
+
test_utils_1.assert.isTrue(wasNewHit);
|
|
50
50
|
}
|
|
51
51
|
static async throwsEvenWhenFakingWithPreviousListeners() {
|
|
52
52
|
//@ts-ignore
|
|
@@ -79,7 +79,7 @@ class FakingErrorResponsesTest extends __1.AbstractSpruceFixtureTest {
|
|
|
79
79
|
});
|
|
80
80
|
await eventFaker_1.default.handleReactiveEvent(fqen);
|
|
81
81
|
const results = await this.client.emit(fqen);
|
|
82
|
-
|
|
82
|
+
test_utils_1.assert.isEqual(results.totalErrors, 0);
|
|
83
83
|
}
|
|
84
84
|
static async canCustomizeTheErrorPassedIn() {
|
|
85
85
|
var _a;
|
|
@@ -88,38 +88,38 @@ class FakingErrorResponsesTest extends __1.AbstractSpruceFixtureTest {
|
|
|
88
88
|
});
|
|
89
89
|
await eventFaker_1.default.makeEventThrow('whoami::v2020_12_25', error);
|
|
90
90
|
const results = await this.client.emit('whoami::v2020_12_25');
|
|
91
|
-
|
|
91
|
+
test_utils_1.assert.isEqualDeep((_a = results.responses[0].errors) === null || _a === void 0 ? void 0 : _a[0], error);
|
|
92
92
|
}
|
|
93
93
|
static async assertResponseIsFakeEventError(fqen, targetAndPayload) {
|
|
94
94
|
const results = await this.client.emit(fqen, targetAndPayload);
|
|
95
|
-
|
|
95
|
+
test_utils_1.assert.isEqual(results.totalErrors, 1);
|
|
96
96
|
spruce_event_utils_1.eventAssertUtil.assertErrorFromResponse(results, 'FAKE_EVENT_ERROR', {
|
|
97
97
|
fqen,
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
__decorate([
|
|
102
|
-
(0,
|
|
103
|
-
(0,
|
|
102
|
+
(0, test_utils_1.test)('faking whoami::v2020_12_25', 'whoami::v2020_12_25'),
|
|
103
|
+
(0, test_utils_1.test)('faking request-pin::v2020_12_25', 'request-pin::v2020_12_25', {
|
|
104
104
|
payload: {
|
|
105
105
|
phone: '+555-000-0001',
|
|
106
106
|
},
|
|
107
107
|
})
|
|
108
108
|
], FakingErrorResponsesTest, "throwsWhenFakingResponse", null);
|
|
109
109
|
__decorate([
|
|
110
|
-
(0,
|
|
111
|
-
(0,
|
|
110
|
+
(0, test_utils_1.test)('on clears previous listeners 1', 'whoami::v2020_12_25'),
|
|
111
|
+
(0, test_utils_1.test)('on clears previous listeners 2', 'what-the::v2020_12_25')
|
|
112
112
|
], FakingErrorResponsesTest, "onClearsPreviousListeners", null);
|
|
113
113
|
__decorate([
|
|
114
|
-
(0,
|
|
114
|
+
(0, test_utils_1.test)()
|
|
115
115
|
], FakingErrorResponsesTest, "throwsEvenWhenFakingWithPreviousListeners", null);
|
|
116
116
|
__decorate([
|
|
117
|
-
(0,
|
|
117
|
+
(0, test_utils_1.test)()
|
|
118
118
|
], FakingErrorResponsesTest, "fakeEventsAreClearedFromPreviousTest", null);
|
|
119
119
|
__decorate([
|
|
120
|
-
(0,
|
|
120
|
+
(0, test_utils_1.test)()
|
|
121
121
|
], FakingErrorResponsesTest, "canFakeEventWithNoResponse", null);
|
|
122
122
|
__decorate([
|
|
123
|
-
(0,
|
|
123
|
+
(0, test_utils_1.test)()
|
|
124
124
|
], FakingErrorResponsesTest, "canCustomizeTheErrorPassedIn", null);
|
|
125
125
|
exports.default = FakingErrorResponsesTest;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import AbstractSpruceTest from '@sprucelabs/test';
|
|
1
|
+
import AbstractSpruceTest from '@sprucelabs/test-utils';
|
|
2
2
|
export default class FixtureFactoryTest extends AbstractSpruceTest {
|
|
3
3
|
protected static throwsWithBadFixture(): void;
|
|
4
4
|
protected static getsFixture(name: string, Class: any): void;
|
|
@@ -32,25 +32,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
32
32
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
const
|
|
36
|
-
const
|
|
35
|
+
const test_utils_1 = __importStar(require("@sprucelabs/test-utils"));
|
|
36
|
+
const test_utils_2 = require("@sprucelabs/test-utils");
|
|
37
37
|
const FixtureFactory_1 = __importDefault(require("../../tests/fixtures/FixtureFactory"));
|
|
38
38
|
const MercuryFixture_1 = __importDefault(require("../../tests/fixtures/MercuryFixture"));
|
|
39
39
|
const OrganizationFixture_1 = __importDefault(require("../../tests/fixtures/OrganizationFixture"));
|
|
40
40
|
const PersonFixture_1 = __importDefault(require("../../tests/fixtures/PersonFixture"));
|
|
41
41
|
const SkillFixture_1 = __importDefault(require("../../tests/fixtures/SkillFixture"));
|
|
42
|
-
class FixtureFactoryTest extends
|
|
42
|
+
class FixtureFactoryTest extends test_utils_1.default {
|
|
43
43
|
static throwsWithBadFixture() {
|
|
44
44
|
//@ts-ignore
|
|
45
|
-
const err =
|
|
46
|
-
|
|
45
|
+
const err = test_utils_1.assert.doesThrow(() => this.Fixture().Fixture('taco'));
|
|
46
|
+
test_utils_2.errorAssert.assertError(err, 'INVALID_FIXTURE', {
|
|
47
47
|
suppliedName: 'taco',
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
static getsFixture(name, Class) {
|
|
51
51
|
//@ts-ignore
|
|
52
52
|
const fixture = this.Fixture().Fixture(name);
|
|
53
|
-
|
|
53
|
+
test_utils_1.assert.isTrue(fixture instanceof Class);
|
|
54
54
|
}
|
|
55
55
|
static Fixture() {
|
|
56
56
|
return new FixtureFactory_1.default({ cwd: this.cwd });
|
|
@@ -59,21 +59,21 @@ class FixtureFactoryTest extends test_1.default {
|
|
|
59
59
|
const { client } = await this.Fixture()
|
|
60
60
|
.Fixture('person')
|
|
61
61
|
.loginAsDemoPerson();
|
|
62
|
-
|
|
62
|
+
test_utils_1.assert.isTrue(client.isConnected());
|
|
63
63
|
await FixtureFactory_1.default.destroy();
|
|
64
|
-
|
|
64
|
+
test_utils_1.assert.isFalse(client.isConnected());
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
__decorate([
|
|
68
|
-
(0,
|
|
68
|
+
(0, test_utils_1.test)()
|
|
69
69
|
], FixtureFactoryTest, "throwsWithBadFixture", null);
|
|
70
70
|
__decorate([
|
|
71
|
-
(0,
|
|
72
|
-
(0,
|
|
73
|
-
(0,
|
|
74
|
-
(0,
|
|
71
|
+
(0, test_utils_1.test)('person fixture', 'person', PersonFixture_1.default),
|
|
72
|
+
(0, test_utils_1.test)('mercury fixture', 'mercury', MercuryFixture_1.default),
|
|
73
|
+
(0, test_utils_1.test)('org fixture', 'organization', OrganizationFixture_1.default),
|
|
74
|
+
(0, test_utils_1.test)('skill fixture', 'skill', SkillFixture_1.default)
|
|
75
75
|
], FixtureFactoryTest, "getsFixture", null);
|
|
76
76
|
__decorate([
|
|
77
|
-
(0,
|
|
77
|
+
(0, test_utils_1.test)()
|
|
78
78
|
], FixtureFactoryTest, "destroyDisconnectsClient", null);
|
|
79
79
|
exports.default = FixtureFactoryTest;
|
|
@@ -10,7 +10,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
10
10
|
};
|
|
11
11
|
var LocationFixtureTest_1;
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
const
|
|
13
|
+
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
14
14
|
const AbstractSpruceFixtureTest_1 = __importDefault(require("../../tests/AbstractSpruceFixtureTest"));
|
|
15
15
|
const constants_1 = require("../../tests/constants");
|
|
16
16
|
const fake_1 = __importDefault(require("../../tests/decorators/fake"));
|
|
@@ -29,11 +29,11 @@ let LocationFixtureTest = LocationFixtureTest_1 = class LocationFixtureTest exte
|
|
|
29
29
|
name: 'Location fixture location',
|
|
30
30
|
organizationId: org.id,
|
|
31
31
|
});
|
|
32
|
-
|
|
32
|
+
test_utils_1.assert.isEqual(org.id, location.organizationId);
|
|
33
33
|
}
|
|
34
34
|
static async canCreatLocationWithNoParams() {
|
|
35
35
|
const location = await this.locations.seedDemoLocation({});
|
|
36
|
-
|
|
36
|
+
test_utils_1.assert.isTruthy(location);
|
|
37
37
|
}
|
|
38
38
|
static async isNotPartOfLocationToStart() {
|
|
39
39
|
const location = await this.locations.seedDemoLocation({
|
|
@@ -45,24 +45,24 @@ let LocationFixtureTest = LocationFixtureTest_1 = class LocationFixtureTest exte
|
|
|
45
45
|
locationId: location.id,
|
|
46
46
|
phone: constants_1.DEMO_NUMBER_LOCATION_FIXTURE,
|
|
47
47
|
});
|
|
48
|
-
|
|
48
|
+
test_utils_1.assert.isFalse(isHired);
|
|
49
49
|
}
|
|
50
50
|
static async uniqueLocationName() {
|
|
51
51
|
const location1 = await this.locations.seedDemoLocation({});
|
|
52
52
|
const location2 = await this.locations.seedDemoLocation({});
|
|
53
|
-
|
|
53
|
+
test_utils_1.assert.isNotEqual(location1.name, location2.name);
|
|
54
54
|
}
|
|
55
55
|
static async locationCountResetBeforeEach() {
|
|
56
56
|
//@ts-ignore
|
|
57
|
-
|
|
57
|
+
test_utils_1.assert.isEqual(LocationFixture_1.default.locationCount, 0);
|
|
58
58
|
}
|
|
59
59
|
static async canAddPersonToLocation() {
|
|
60
60
|
const { person, location } = await this.seedLocationAndAddPerson();
|
|
61
61
|
const isHired = await LocationFixtureTest_1.isPersonPartOfLocation(person.id, location.id);
|
|
62
|
-
|
|
62
|
+
test_utils_1.assert.isTrue(isHired);
|
|
63
63
|
}
|
|
64
64
|
static async throwsWhenTryingToRemovePersonWithBadIds() {
|
|
65
|
-
await
|
|
65
|
+
await test_utils_1.assert.doesThrowAsync(() => this.locations.removePerson({
|
|
66
66
|
phone: constants_1.DEMO_NUMBER_LOCATION_FIXTURE,
|
|
67
67
|
personId: 'aoeu',
|
|
68
68
|
locationId: 'aoeu',
|
|
@@ -80,7 +80,7 @@ let LocationFixtureTest = LocationFixtureTest_1 = class LocationFixtureTest exte
|
|
|
80
80
|
roleBase: 'guest',
|
|
81
81
|
});
|
|
82
82
|
const isHired = await this.isPersonPartOfLocation(person.id, location.id);
|
|
83
|
-
|
|
83
|
+
test_utils_1.assert.isFalse(isHired);
|
|
84
84
|
}
|
|
85
85
|
static async isPersonPartOfLocation(personId, locationId) {
|
|
86
86
|
return await this.locations.isPartOfLocation({
|
|
@@ -115,28 +115,28 @@ let LocationFixtureTest = LocationFixtureTest_1 = class LocationFixtureTest exte
|
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
117
|
__decorate([
|
|
118
|
-
(0,
|
|
118
|
+
(0, test_utils_1.test)()
|
|
119
119
|
], LocationFixtureTest, "canCreateWithSpecificOrg", null);
|
|
120
120
|
__decorate([
|
|
121
|
-
(0,
|
|
121
|
+
(0, test_utils_1.test)()
|
|
122
122
|
], LocationFixtureTest, "canCreatLocationWithNoParams", null);
|
|
123
123
|
__decorate([
|
|
124
|
-
(0,
|
|
124
|
+
(0, test_utils_1.test)()
|
|
125
125
|
], LocationFixtureTest, "isNotPartOfLocationToStart", null);
|
|
126
126
|
__decorate([
|
|
127
|
-
(0,
|
|
127
|
+
(0, test_utils_1.test)()
|
|
128
128
|
], LocationFixtureTest, "uniqueLocationName", null);
|
|
129
129
|
__decorate([
|
|
130
|
-
(0,
|
|
130
|
+
(0, test_utils_1.test)()
|
|
131
131
|
], LocationFixtureTest, "locationCountResetBeforeEach", null);
|
|
132
132
|
__decorate([
|
|
133
|
-
(0,
|
|
133
|
+
(0, test_utils_1.test)()
|
|
134
134
|
], LocationFixtureTest, "canAddPersonToLocation", null);
|
|
135
135
|
__decorate([
|
|
136
|
-
(0,
|
|
136
|
+
(0, test_utils_1.test)()
|
|
137
137
|
], LocationFixtureTest, "throwsWhenTryingToRemovePersonWithBadIds", null);
|
|
138
138
|
__decorate([
|
|
139
|
-
(0,
|
|
139
|
+
(0, test_utils_1.test)()
|
|
140
140
|
], LocationFixtureTest, "canRemoveRole", null);
|
|
141
141
|
LocationFixtureTest = LocationFixtureTest_1 = __decorate([
|
|
142
142
|
fake_1.default.login(constants_1.DEMO_NUMBER_LOCATION_FIXTURE)
|
|
@@ -10,7 +10,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const spruce_event_utils_1 = require("@sprucelabs/spruce-event-utils");
|
|
13
|
-
const
|
|
13
|
+
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
14
14
|
const __1 = require("../..");
|
|
15
15
|
const ClientProxyDecorator_1 = __importDefault(require("../../ClientProxyDecorator"));
|
|
16
16
|
const constants_1 = require("../../tests/constants");
|
|
@@ -22,7 +22,7 @@ let LoginDecoratorHandlingProxiesForMeTest = class LoginDecoratorHandlingProxies
|
|
|
22
22
|
};
|
|
23
23
|
});
|
|
24
24
|
const token = await this.generateToken();
|
|
25
|
-
|
|
25
|
+
test_utils_1.assert.isEqual(token, expected);
|
|
26
26
|
}
|
|
27
27
|
static async onlyEmitsEventOnce() {
|
|
28
28
|
let hitCount = 0;
|
|
@@ -34,20 +34,20 @@ let LoginDecoratorHandlingProxiesForMeTest = class LoginDecoratorHandlingProxies
|
|
|
34
34
|
});
|
|
35
35
|
const generator = this.getDecorator().getProxyTokenGenerator();
|
|
36
36
|
await (generator === null || generator === void 0 ? void 0 : generator());
|
|
37
|
-
|
|
37
|
+
test_utils_1.assert.isEqual(hitCount, 0);
|
|
38
38
|
await (generator === null || generator === void 0 ? void 0 : generator());
|
|
39
39
|
await (generator === null || generator === void 0 ? void 0 : generator());
|
|
40
|
-
|
|
40
|
+
test_utils_1.assert.isEqual(hitCount, 0);
|
|
41
41
|
}
|
|
42
42
|
static async tokenSetBackAfterEachTest() {
|
|
43
43
|
this.lastToken = await this.generateToken();
|
|
44
44
|
await this.loginAsSecondPerson();
|
|
45
45
|
const newToken = await this.generateToken();
|
|
46
|
-
|
|
46
|
+
test_utils_1.assert.isNotEqual(this.lastToken, newToken);
|
|
47
47
|
}
|
|
48
48
|
static async tokenBackToOriginLoggedInPerson() {
|
|
49
49
|
const token = await this.generateToken();
|
|
50
|
-
|
|
50
|
+
test_utils_1.assert.isEqual(this.lastToken, token);
|
|
51
51
|
}
|
|
52
52
|
static async loggingAnAsDemoPerson2AgainSetsValidProxy() {
|
|
53
53
|
const { client } = await this.loginAsSecondPerson();
|
|
@@ -72,19 +72,19 @@ let LoginDecoratorHandlingProxiesForMeTest = class LoginDecoratorHandlingProxies
|
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
74
|
__decorate([
|
|
75
|
-
(0,
|
|
75
|
+
(0, test_utils_1.test)('proxy set to random', `${Math.random() * new Date().getTime()}`)
|
|
76
76
|
], LoginDecoratorHandlingProxiesForMeTest, "proxyTokenGeneratorReturnsExpectedProxyToken", null);
|
|
77
77
|
__decorate([
|
|
78
|
-
(0,
|
|
78
|
+
(0, test_utils_1.test)()
|
|
79
79
|
], LoginDecoratorHandlingProxiesForMeTest, "onlyEmitsEventOnce", null);
|
|
80
80
|
__decorate([
|
|
81
|
-
(0,
|
|
81
|
+
(0, test_utils_1.test)()
|
|
82
82
|
], LoginDecoratorHandlingProxiesForMeTest, "tokenSetBackAfterEachTest", null);
|
|
83
83
|
__decorate([
|
|
84
|
-
(0,
|
|
84
|
+
(0, test_utils_1.test)()
|
|
85
85
|
], LoginDecoratorHandlingProxiesForMeTest, "tokenBackToOriginLoggedInPerson", null);
|
|
86
86
|
__decorate([
|
|
87
|
-
(0,
|
|
87
|
+
(0, test_utils_1.test)()
|
|
88
88
|
], LoginDecoratorHandlingProxiesForMeTest, "loggingAnAsDemoPerson2AgainSetsValidProxy", null);
|
|
89
89
|
LoginDecoratorHandlingProxiesForMeTest = __decorate([
|
|
90
90
|
(0, __1.login)(constants_1.DEMO_NUMBER_LOGIN_DECORATOR)
|
|
@@ -8,7 +8,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
const mercury_client_1 = require("@sprucelabs/mercury-client");
|
|
10
10
|
const spruce_skill_utils_1 = require("@sprucelabs/spruce-skill-utils");
|
|
11
|
-
const
|
|
11
|
+
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
12
12
|
const __1 = require("../..");
|
|
13
13
|
const constants_1 = require("../../tests/constants");
|
|
14
14
|
let MakingSureLocalEventsAreHandledLocallyTest = class MakingSureLocalEventsAreHandledLocallyTest extends __1.AbstractSpruceFixtureTest {
|
|
@@ -17,11 +17,11 @@ let MakingSureLocalEventsAreHandledLocallyTest = class MakingSureLocalEventsAreH
|
|
|
17
17
|
const skill = await this.Fixture('skill').seedDemoSkill();
|
|
18
18
|
spruce_skill_utils_1.AuthService.Auth(this.cwd).updateCurrentSkill(skill);
|
|
19
19
|
await __1.MercuryFixture.beforeEach(this.cwd);
|
|
20
|
-
|
|
20
|
+
test_utils_1.assert.isEqualDeep(mercury_client_1.MercuryTestClient.getNamespacesThatMustBeHandledLocally(), [skill.slug]);
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
__decorate([
|
|
24
|
-
(0,
|
|
24
|
+
(0, test_utils_1.test)()
|
|
25
25
|
], MakingSureLocalEventsAreHandledLocallyTest, "throwsWhenNoListenerSetForLocalEvent", null);
|
|
26
26
|
MakingSureLocalEventsAreHandledLocallyTest = __decorate([
|
|
27
27
|
(0, __1.login)(constants_1.DEMO_NUMBER_HANDLING_EVENTS_LOCALLY)
|