@etsoo/appscript 1.4.88 → 1.4.89
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/__tests__/app/CoreApp.ts +34 -1
- package/package.json +2 -2
package/__tests__/app/CoreApp.ts
CHANGED
|
@@ -6,7 +6,12 @@ import {
|
|
|
6
6
|
NotificationContainer,
|
|
7
7
|
NotificationRenderProps
|
|
8
8
|
} from '@etsoo/notificationbase';
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
ApiAuthorizationScheme,
|
|
11
|
+
ApiDataError,
|
|
12
|
+
ApiMethod,
|
|
13
|
+
createClient
|
|
14
|
+
} from '@etsoo/restclient';
|
|
10
15
|
import {
|
|
11
16
|
DataTypes,
|
|
12
17
|
DomUtils,
|
|
@@ -259,6 +264,34 @@ test('Tests for formatResult', () => {
|
|
|
259
264
|
);
|
|
260
265
|
});
|
|
261
266
|
|
|
267
|
+
test('Tests for formatError', () => {
|
|
268
|
+
const error: ApiDataError = {
|
|
269
|
+
name: 'ApiDataError',
|
|
270
|
+
message: 'Api data error',
|
|
271
|
+
response: {
|
|
272
|
+
type: 'https://tools.ietf.org/html/rfc9110#section-15.5.1',
|
|
273
|
+
title: 'One or more validation errors occurred.',
|
|
274
|
+
status: 400,
|
|
275
|
+
errors: {
|
|
276
|
+
$: [
|
|
277
|
+
'JSON deserialization for type \u0027com.etsoo.CMS.RQ.User.UserCreateRQ\u0027 was missing required properties, including the following: password'
|
|
278
|
+
],
|
|
279
|
+
rq: ['The rq field is required.']
|
|
280
|
+
},
|
|
281
|
+
traceId: '00-ed96a4f0c83f066594ecc69b77da9803-df770e3cd714fedd-00'
|
|
282
|
+
},
|
|
283
|
+
data: {
|
|
284
|
+
data: undefined,
|
|
285
|
+
headers: [],
|
|
286
|
+
method: ApiMethod.POST,
|
|
287
|
+
params: {},
|
|
288
|
+
url: ''
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
expect(app.formatError(error)).toBe('Api data error (ApiDataError)');
|
|
293
|
+
});
|
|
294
|
+
|
|
262
295
|
test('Tests for isValidPassword', () => {
|
|
263
296
|
expect(app.isValidPassword('12345678')).toBeFalsy();
|
|
264
297
|
expect(app.isValidPassword('abcd3')).toBeFalsy();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/appscript",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.89",
|
|
4
4
|
"description": "Applications shared TypeScript framework",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"homepage": "https://github.com/ETSOO/AppScript#readme",
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@etsoo/notificationbase": "^1.1.42",
|
|
56
|
-
"@etsoo/restclient": "^1.1.
|
|
56
|
+
"@etsoo/restclient": "^1.1.4",
|
|
57
57
|
"@etsoo/shared": "^1.2.40",
|
|
58
58
|
"crypto-js": "^4.2.0"
|
|
59
59
|
},
|