@workos-inc/node 5.2.0 → 6.0.0-rc.2
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/lib/audit-logs/audit-logs.spec.js +18 -4
- package/lib/common/interfaces/workos-options.interface.d.ts +1 -2
- package/lib/common/utils/fetch-client.d.ts +29 -0
- package/lib/common/utils/fetch-client.js +97 -0
- package/lib/common/utils/fetch-error.d.ts +13 -0
- package/lib/common/utils/fetch-error.js +13 -0
- package/lib/common/utils/test-utils.d.ts +8 -0
- package/lib/common/utils/test-utils.js +45 -0
- package/lib/directory-sync/directory-sync.spec.js +34 -45
- package/lib/events/events.spec.js +5 -6
- package/lib/mfa/mfa.spec.js +39 -42
- package/lib/organization-domains/organization-domains.spec.js +12 -24
- package/lib/organizations/organizations.spec.js +49 -74
- package/lib/passwordless/passwordless.spec.js +9 -16
- package/lib/portal/portal.spec.js +41 -47
- package/lib/sso/sso.spec.js +56 -100
- package/lib/user-management/user-management.spec.js +90 -123
- package/lib/webhooks/webhooks.d.ts +5 -5
- package/lib/webhooks/webhooks.js +64 -42
- package/lib/webhooks/webhooks.spec.js +40 -30
- package/lib/workos.d.ts +11 -6
- package/lib/workos.js +16 -19
- package/lib/workos.spec.js +17 -22
- package/package.json +3 -2
|
@@ -12,120 +12,114 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const
|
|
16
|
-
const
|
|
15
|
+
const jest_fetch_mock_1 = __importDefault(require("jest-fetch-mock"));
|
|
16
|
+
const test_utils_1 = require("../common/utils/test-utils");
|
|
17
17
|
const workos_1 = require("../workos");
|
|
18
18
|
const generate_link_invalid_json_1 = __importDefault(require("./fixtures/generate-link-invalid.json"));
|
|
19
19
|
const generate_link_json_1 = __importDefault(require("./fixtures/generate-link.json"));
|
|
20
20
|
const generate_portal_link_intent_interface_1 = require("./interfaces/generate-portal-link-intent.interface");
|
|
21
|
-
const mock = new axios_mock_adapter_1.default(axios_1.default);
|
|
22
21
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU');
|
|
23
22
|
describe('Portal', () => {
|
|
24
|
-
|
|
23
|
+
beforeEach(() => jest_fetch_mock_1.default.resetMocks());
|
|
25
24
|
describe('generateLink', () => {
|
|
26
25
|
describe('with a valid organization', () => {
|
|
27
26
|
describe('with the sso intent', () => {
|
|
28
27
|
it('returns an Admin Portal link', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
|
-
|
|
30
|
-
.onPost('/portal/generate_link', {
|
|
31
|
-
intent: generate_portal_link_intent_interface_1.GeneratePortalLinkIntent.SSO,
|
|
32
|
-
organization: 'org_01EHQMYV6MBK39QC5PZXHY59C3',
|
|
33
|
-
return_url: 'https://www.example.com',
|
|
34
|
-
})
|
|
35
|
-
.replyOnce(201, generate_link_json_1.default);
|
|
28
|
+
(0, test_utils_1.fetchOnce)(generate_link_json_1.default, { status: 201 });
|
|
36
29
|
const { link } = yield workos.portal.generateLink({
|
|
37
30
|
intent: generate_portal_link_intent_interface_1.GeneratePortalLinkIntent.SSO,
|
|
38
31
|
organization: 'org_01EHQMYV6MBK39QC5PZXHY59C3',
|
|
39
32
|
returnUrl: 'https://www.example.com',
|
|
40
33
|
});
|
|
34
|
+
expect((0, test_utils_1.fetchBody)()).toEqual({
|
|
35
|
+
intent: generate_portal_link_intent_interface_1.GeneratePortalLinkIntent.SSO,
|
|
36
|
+
organization: 'org_01EHQMYV6MBK39QC5PZXHY59C3',
|
|
37
|
+
return_url: 'https://www.example.com',
|
|
38
|
+
});
|
|
41
39
|
expect(link).toEqual('https://id.workos.com/portal/launch?secret=secret');
|
|
42
40
|
}));
|
|
43
41
|
});
|
|
44
42
|
describe('with the domain_verification intent', () => {
|
|
45
43
|
it('returns an Admin Portal link', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
46
|
-
|
|
47
|
-
.onPost('/portal/generate_link', {
|
|
48
|
-
intent: generate_portal_link_intent_interface_1.GeneratePortalLinkIntent.DomainVerification,
|
|
49
|
-
organization: 'org_01EHQMYV6MBK39QC5PZXHY59C3',
|
|
50
|
-
return_url: 'https://www.example.com',
|
|
51
|
-
})
|
|
52
|
-
.replyOnce(201, generate_link_json_1.default);
|
|
44
|
+
(0, test_utils_1.fetchOnce)(generate_link_json_1.default, { status: 201 });
|
|
53
45
|
const { link } = yield workos.portal.generateLink({
|
|
54
46
|
intent: generate_portal_link_intent_interface_1.GeneratePortalLinkIntent.DomainVerification,
|
|
55
47
|
organization: 'org_01EHQMYV6MBK39QC5PZXHY59C3',
|
|
56
48
|
returnUrl: 'https://www.example.com',
|
|
57
49
|
});
|
|
50
|
+
expect((0, test_utils_1.fetchBody)()).toEqual({
|
|
51
|
+
intent: generate_portal_link_intent_interface_1.GeneratePortalLinkIntent.DomainVerification,
|
|
52
|
+
organization: 'org_01EHQMYV6MBK39QC5PZXHY59C3',
|
|
53
|
+
return_url: 'https://www.example.com',
|
|
54
|
+
});
|
|
58
55
|
expect(link).toEqual('https://id.workos.com/portal/launch?secret=secret');
|
|
59
56
|
}));
|
|
60
57
|
});
|
|
61
58
|
describe('with the dsync intent', () => {
|
|
62
59
|
it('returns an Admin Portal link', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
63
|
-
|
|
64
|
-
.onPost('/portal/generate_link', {
|
|
65
|
-
intent: generate_portal_link_intent_interface_1.GeneratePortalLinkIntent.DSync,
|
|
66
|
-
organization: 'org_01EHQMYV6MBK39QC5PZXHY59C3',
|
|
67
|
-
return_url: 'https://www.example.com',
|
|
68
|
-
})
|
|
69
|
-
.reply(201, generate_link_json_1.default);
|
|
60
|
+
(0, test_utils_1.fetchOnce)(generate_link_json_1.default, { status: 201 });
|
|
70
61
|
const { link } = yield workos.portal.generateLink({
|
|
71
62
|
intent: generate_portal_link_intent_interface_1.GeneratePortalLinkIntent.DSync,
|
|
72
63
|
organization: 'org_01EHQMYV6MBK39QC5PZXHY59C3',
|
|
73
64
|
returnUrl: 'https://www.example.com',
|
|
74
65
|
});
|
|
66
|
+
expect((0, test_utils_1.fetchBody)()).toEqual({
|
|
67
|
+
intent: generate_portal_link_intent_interface_1.GeneratePortalLinkIntent.DSync,
|
|
68
|
+
organization: 'org_01EHQMYV6MBK39QC5PZXHY59C3',
|
|
69
|
+
return_url: 'https://www.example.com',
|
|
70
|
+
});
|
|
75
71
|
expect(link).toEqual('https://id.workos.com/portal/launch?secret=secret');
|
|
76
72
|
}));
|
|
77
73
|
});
|
|
78
74
|
describe('with the `audit_logs` intent', () => {
|
|
79
75
|
it('returns an Admin Portal link', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
80
|
-
|
|
81
|
-
.onPost('/portal/generate_link', {
|
|
82
|
-
intent: generate_portal_link_intent_interface_1.GeneratePortalLinkIntent.AuditLogs,
|
|
83
|
-
organization: 'org_01EHQMYV6MBK39QC5PZXHY59C3',
|
|
84
|
-
return_url: 'https://www.example.com',
|
|
85
|
-
})
|
|
86
|
-
.reply(201, generate_link_json_1.default);
|
|
76
|
+
(0, test_utils_1.fetchOnce)(generate_link_json_1.default, { status: 201 });
|
|
87
77
|
const { link } = yield workos.portal.generateLink({
|
|
88
78
|
intent: generate_portal_link_intent_interface_1.GeneratePortalLinkIntent.AuditLogs,
|
|
89
79
|
organization: 'org_01EHQMYV6MBK39QC5PZXHY59C3',
|
|
90
80
|
returnUrl: 'https://www.example.com',
|
|
91
81
|
});
|
|
82
|
+
expect((0, test_utils_1.fetchBody)()).toEqual({
|
|
83
|
+
intent: generate_portal_link_intent_interface_1.GeneratePortalLinkIntent.AuditLogs,
|
|
84
|
+
organization: 'org_01EHQMYV6MBK39QC5PZXHY59C3',
|
|
85
|
+
return_url: 'https://www.example.com',
|
|
86
|
+
});
|
|
92
87
|
expect(link).toEqual('https://id.workos.com/portal/launch?secret=secret');
|
|
93
88
|
}));
|
|
94
89
|
});
|
|
95
90
|
describe('with the `log_streams` intent', () => {
|
|
96
91
|
it('returns an Admin Portal link', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
97
|
-
|
|
98
|
-
.onPost('/portal/generate_link', {
|
|
99
|
-
intent: generate_portal_link_intent_interface_1.GeneratePortalLinkIntent.LogStreams,
|
|
100
|
-
organization: 'org_01EHQMYV6MBK39QC5PZXHY59C3',
|
|
101
|
-
return_url: 'https://www.example.com',
|
|
102
|
-
})
|
|
103
|
-
.reply(201, generate_link_json_1.default);
|
|
92
|
+
(0, test_utils_1.fetchOnce)(generate_link_json_1.default, { status: 201 });
|
|
104
93
|
const { link } = yield workos.portal.generateLink({
|
|
105
94
|
intent: generate_portal_link_intent_interface_1.GeneratePortalLinkIntent.LogStreams,
|
|
106
95
|
organization: 'org_01EHQMYV6MBK39QC5PZXHY59C3',
|
|
107
96
|
returnUrl: 'https://www.example.com',
|
|
108
97
|
});
|
|
98
|
+
expect((0, test_utils_1.fetchBody)()).toEqual({
|
|
99
|
+
intent: generate_portal_link_intent_interface_1.GeneratePortalLinkIntent.LogStreams,
|
|
100
|
+
organization: 'org_01EHQMYV6MBK39QC5PZXHY59C3',
|
|
101
|
+
return_url: 'https://www.example.com',
|
|
102
|
+
});
|
|
109
103
|
expect(link).toEqual('https://id.workos.com/portal/launch?secret=secret');
|
|
110
104
|
}));
|
|
111
105
|
});
|
|
112
106
|
});
|
|
113
107
|
describe('with an invalid organization', () => {
|
|
114
108
|
it('throws an error', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
organization: 'bogus-id',
|
|
119
|
-
return_url: 'https://www.example.com',
|
|
120
|
-
})
|
|
121
|
-
.reply(400, generate_link_invalid_json_1.default, {
|
|
122
|
-
'X-Request-ID': 'a-request-id',
|
|
109
|
+
(0, test_utils_1.fetchOnce)(generate_link_invalid_json_1.default, {
|
|
110
|
+
status: 400,
|
|
111
|
+
headers: { 'X-Request-ID': 'a-request-id' },
|
|
123
112
|
});
|
|
124
113
|
yield expect(workos.portal.generateLink({
|
|
125
114
|
intent: generate_portal_link_intent_interface_1.GeneratePortalLinkIntent.SSO,
|
|
126
115
|
organization: 'bogus-id',
|
|
127
116
|
returnUrl: 'https://www.example.com',
|
|
128
117
|
})).rejects.toThrowError('Could not find an organization with the id, bogus-id.');
|
|
118
|
+
expect((0, test_utils_1.fetchBody)()).toEqual({
|
|
119
|
+
intent: generate_portal_link_intent_interface_1.GeneratePortalLinkIntent.SSO,
|
|
120
|
+
organization: 'bogus-id',
|
|
121
|
+
return_url: 'https://www.example.com',
|
|
122
|
+
});
|
|
129
123
|
}));
|
|
130
124
|
});
|
|
131
125
|
});
|
package/lib/sso/sso.spec.js
CHANGED
|
@@ -12,11 +12,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const
|
|
16
|
-
const
|
|
15
|
+
const jest_fetch_mock_1 = __importDefault(require("jest-fetch-mock"));
|
|
16
|
+
const test_utils_1 = require("../common/utils/test-utils");
|
|
17
17
|
const workos_1 = require("../workos");
|
|
18
18
|
const interfaces_1 = require("./interfaces");
|
|
19
19
|
describe('SSO', () => {
|
|
20
|
+
beforeEach(() => jest_fetch_mock_1.default.resetMocks());
|
|
20
21
|
const connectionResponse = {
|
|
21
22
|
object: 'connection',
|
|
22
23
|
id: 'conn_123',
|
|
@@ -145,104 +146,66 @@ describe('SSO', () => {
|
|
|
145
146
|
describe('getProfileAndToken', () => {
|
|
146
147
|
describe('with all information provided', () => {
|
|
147
148
|
it('sends a request to the WorkOS api for a profile', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
organization_id: 'org_123',
|
|
168
|
-
connection_id: 'conn_123',
|
|
169
|
-
connection_type: 'OktaSAML',
|
|
170
|
-
email: 'foo@test.com',
|
|
171
|
-
first_name: 'foo',
|
|
172
|
-
last_name: 'bar',
|
|
173
|
-
groups: ['Admins', 'Developers'],
|
|
174
|
-
raw_attributes: {
|
|
175
|
-
email: 'foo@test.com',
|
|
176
|
-
first_name: 'foo',
|
|
177
|
-
last_name: 'bar',
|
|
178
|
-
groups: ['Admins', 'Developers'],
|
|
179
|
-
},
|
|
180
|
-
},
|
|
181
|
-
},
|
|
182
|
-
];
|
|
183
|
-
}
|
|
184
|
-
return [404];
|
|
149
|
+
(0, test_utils_1.fetchOnce)({
|
|
150
|
+
access_token: '01DMEK0J53CVMC32CK5SE0KZ8Q',
|
|
151
|
+
profile: {
|
|
152
|
+
id: 'prof_123',
|
|
153
|
+
idp_id: '123',
|
|
154
|
+
organization_id: 'org_123',
|
|
155
|
+
connection_id: 'conn_123',
|
|
156
|
+
connection_type: 'OktaSAML',
|
|
157
|
+
email: 'foo@test.com',
|
|
158
|
+
first_name: 'foo',
|
|
159
|
+
last_name: 'bar',
|
|
160
|
+
groups: ['Admins', 'Developers'],
|
|
161
|
+
raw_attributes: {
|
|
162
|
+
email: 'foo@test.com',
|
|
163
|
+
first_name: 'foo',
|
|
164
|
+
last_name: 'bar',
|
|
165
|
+
groups: ['Admins', 'Developers'],
|
|
166
|
+
},
|
|
167
|
+
},
|
|
185
168
|
});
|
|
186
169
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU');
|
|
187
170
|
const { accessToken, profile } = yield workos.sso.getProfileAndToken({
|
|
188
171
|
code: 'authorization_code',
|
|
189
172
|
clientId: 'proj_123',
|
|
190
173
|
});
|
|
191
|
-
expect(mock.
|
|
192
|
-
|
|
193
|
-
expect(
|
|
194
|
-
expect(headers).toMatchSnapshot();
|
|
174
|
+
expect(jest_fetch_mock_1.default.mock.calls.length).toEqual(1);
|
|
175
|
+
expect((0, test_utils_1.fetchBody)()).toMatchSnapshot();
|
|
176
|
+
expect((0, test_utils_1.fetchHeaders)()).toMatchSnapshot();
|
|
195
177
|
expect(accessToken).toBe('01DMEK0J53CVMC32CK5SE0KZ8Q');
|
|
196
178
|
expect(profile).toMatchSnapshot();
|
|
197
179
|
}));
|
|
198
180
|
});
|
|
199
181
|
describe('without a groups attribute', () => {
|
|
200
182
|
it('sends a request to the WorkOS api for a profile', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
id: 'prof_123',
|
|
219
|
-
idp_id: '123',
|
|
220
|
-
organization_id: 'org_123',
|
|
221
|
-
connection_id: 'conn_123',
|
|
222
|
-
connection_type: 'OktaSAML',
|
|
223
|
-
email: 'foo@test.com',
|
|
224
|
-
first_name: 'foo',
|
|
225
|
-
last_name: 'bar',
|
|
226
|
-
raw_attributes: {
|
|
227
|
-
email: 'foo@test.com',
|
|
228
|
-
first_name: 'foo',
|
|
229
|
-
last_name: 'bar',
|
|
230
|
-
},
|
|
231
|
-
},
|
|
232
|
-
},
|
|
233
|
-
];
|
|
234
|
-
}
|
|
235
|
-
return [404];
|
|
183
|
+
(0, test_utils_1.fetchOnce)({
|
|
184
|
+
access_token: '01DMEK0J53CVMC32CK5SE0KZ8Q',
|
|
185
|
+
profile: {
|
|
186
|
+
id: 'prof_123',
|
|
187
|
+
idp_id: '123',
|
|
188
|
+
organization_id: 'org_123',
|
|
189
|
+
connection_id: 'conn_123',
|
|
190
|
+
connection_type: 'OktaSAML',
|
|
191
|
+
email: 'foo@test.com',
|
|
192
|
+
first_name: 'foo',
|
|
193
|
+
last_name: 'bar',
|
|
194
|
+
raw_attributes: {
|
|
195
|
+
email: 'foo@test.com',
|
|
196
|
+
first_name: 'foo',
|
|
197
|
+
last_name: 'bar',
|
|
198
|
+
},
|
|
199
|
+
},
|
|
236
200
|
});
|
|
237
201
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU');
|
|
238
202
|
const { accessToken, profile } = yield workos.sso.getProfileAndToken({
|
|
239
203
|
code: 'authorization_code',
|
|
240
204
|
clientId: 'proj_123',
|
|
241
205
|
});
|
|
242
|
-
expect(mock.
|
|
243
|
-
|
|
244
|
-
expect(
|
|
245
|
-
expect(headers).toMatchSnapshot();
|
|
206
|
+
expect(jest_fetch_mock_1.default.mock.calls.length).toEqual(1);
|
|
207
|
+
expect((0, test_utils_1.fetchBody)()).toMatchSnapshot();
|
|
208
|
+
expect((0, test_utils_1.fetchHeaders)()).toMatchSnapshot();
|
|
246
209
|
expect(accessToken).toBe('01DMEK0J53CVMC32CK5SE0KZ8Q');
|
|
247
210
|
expect(profile).toMatchSnapshot();
|
|
248
211
|
}));
|
|
@@ -250,12 +213,7 @@ describe('SSO', () => {
|
|
|
250
213
|
});
|
|
251
214
|
describe('getProfile', () => {
|
|
252
215
|
it('calls the `/sso/profile` endpoint with the provided access token', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
253
|
-
|
|
254
|
-
mock
|
|
255
|
-
.onGet('/sso/profile', {
|
|
256
|
-
accessToken: 'access_token',
|
|
257
|
-
})
|
|
258
|
-
.replyOnce(200, {
|
|
216
|
+
(0, test_utils_1.fetchOnce)({
|
|
259
217
|
id: 'prof_123',
|
|
260
218
|
idp_id: '123',
|
|
261
219
|
organization_id: 'org_123',
|
|
@@ -276,35 +234,33 @@ describe('SSO', () => {
|
|
|
276
234
|
const profile = yield workos.sso.getProfile({
|
|
277
235
|
accessToken: 'access_token',
|
|
278
236
|
});
|
|
279
|
-
expect(mock.
|
|
280
|
-
|
|
281
|
-
|
|
237
|
+
expect(jest_fetch_mock_1.default.mock.calls.length).toEqual(1);
|
|
238
|
+
expect((0, test_utils_1.fetchHeaders)()).toMatchObject({
|
|
239
|
+
Authorization: 'Bearer access_token',
|
|
240
|
+
});
|
|
282
241
|
expect(profile.id).toBe('prof_123');
|
|
283
242
|
}));
|
|
284
243
|
});
|
|
285
244
|
describe('deleteConnection', () => {
|
|
286
245
|
it('sends request to delete a Connection', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
287
|
-
|
|
288
|
-
mock.onDelete('/connections/conn_123').replyOnce(200, {});
|
|
246
|
+
(0, test_utils_1.fetchOnce)();
|
|
289
247
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU');
|
|
290
248
|
yield workos.sso.deleteConnection('conn_123');
|
|
291
|
-
expect(
|
|
249
|
+
expect((0, test_utils_1.fetchURL)()).toContain('/connections/conn_123');
|
|
292
250
|
}));
|
|
293
251
|
});
|
|
294
252
|
describe('getConnection', () => {
|
|
295
253
|
it(`requests a Connection`, () => __awaiter(void 0, void 0, void 0, function* () {
|
|
296
|
-
|
|
297
|
-
mock.onGet('/connections/conn_123').replyOnce(200, connectionResponse);
|
|
254
|
+
(0, test_utils_1.fetchOnce)(connectionResponse);
|
|
298
255
|
const workos = new workos_1.WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU');
|
|
299
256
|
const subject = yield workos.sso.getConnection('conn_123');
|
|
300
|
-
expect(
|
|
257
|
+
expect((0, test_utils_1.fetchURL)()).toContain('/connections/conn_123');
|
|
301
258
|
expect(subject.connectionType).toEqual('OktaSAML');
|
|
302
259
|
}));
|
|
303
260
|
});
|
|
304
261
|
describe('listConnections', () => {
|
|
305
262
|
it(`requests a list of Connections`, () => __awaiter(void 0, void 0, void 0, function* () {
|
|
306
|
-
|
|
307
|
-
mock.onGet('/connections').replyOnce(200, {
|
|
263
|
+
(0, test_utils_1.fetchOnce)({
|
|
308
264
|
data: [connectionResponse],
|
|
309
265
|
list_metadata: {},
|
|
310
266
|
});
|
|
@@ -312,7 +268,7 @@ describe('SSO', () => {
|
|
|
312
268
|
const subject = yield workos.sso.listConnections({
|
|
313
269
|
organizationId: 'org_1234',
|
|
314
270
|
});
|
|
315
|
-
expect(
|
|
271
|
+
expect((0, test_utils_1.fetchURL)()).toContain('/connections');
|
|
316
272
|
expect(subject.data).toHaveLength(1);
|
|
317
273
|
}));
|
|
318
274
|
});
|