@cloudcommerce/app-loyalty-points 0.24.1 → 0.26.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/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
> @cloudcommerce/app-loyalty-points@0.
|
|
2
|
+
> @cloudcommerce/app-loyalty-points@0.25.0 build /home/leo/code/ecomplus/cloud-commerce/packages/apps/loyalty-points
|
|
3
3
|
> bash ../../../scripts/build-lib.sh
|
|
4
4
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcommerce/app-loyalty-points",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.26.0",
|
|
5
5
|
"description": "E-Com Plus Cloud Commerce app to handle simple loyalty points programs",
|
|
6
6
|
"main": "lib/loyalty-points.js",
|
|
7
7
|
"exports": {
|
|
@@ -20,13 +20,15 @@
|
|
|
20
20
|
},
|
|
21
21
|
"homepage": "https://github.com/ecomplus/cloud-commerce/tree/main/packages/apps/loyalty-points#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@cloudcommerce/
|
|
24
|
-
"@cloudcommerce/
|
|
23
|
+
"@cloudcommerce/firebase": "0.26.0",
|
|
24
|
+
"@cloudcommerce/api": "0.26.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@cloudcommerce/
|
|
27
|
+
"@cloudcommerce/test-base": "0.26.0",
|
|
28
|
+
"@cloudcommerce/types": "0.26.0"
|
|
28
29
|
},
|
|
29
30
|
"scripts": {
|
|
30
|
-
"build": "bash ../../../scripts/build-lib.sh"
|
|
31
|
+
"build": "bash ../../../scripts/build-lib.sh",
|
|
32
|
+
"test:e2e": "node --test tests/"
|
|
31
33
|
}
|
|
32
34
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
+
import assert from 'node:assert';
|
|
3
|
+
import test, { before, describe } from 'node:test';
|
|
4
|
+
import {
|
|
5
|
+
modulesUrl,
|
|
6
|
+
bodyListPayments,
|
|
7
|
+
} from '@cloudcommerce/test-base';
|
|
8
|
+
|
|
9
|
+
describe('Test payment list of Loyalty Points App', async () => {
|
|
10
|
+
let req;
|
|
11
|
+
let data;
|
|
12
|
+
const appId = 124890;
|
|
13
|
+
|
|
14
|
+
before(async () => {
|
|
15
|
+
req = await fetch(`${modulesUrl}/list_payments?app_id=${appId}`, {
|
|
16
|
+
method: 'POST',
|
|
17
|
+
body: JSON.stringify(bodyListPayments),
|
|
18
|
+
headers: {
|
|
19
|
+
'Content-Type': 'application/json',
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
data = (await req.json()).result;
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test('Check Status 200', async () => {
|
|
27
|
+
assert.strictEqual(req?.status, 200);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test('Check validated is true', async () => {
|
|
31
|
+
assert.equal(data[0].validated, true);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test('Have payment gateways', async () => {
|
|
35
|
+
assert.notEqual(data[0].response.payment_gateways.length, 0);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
+
import assert from 'node:assert';
|
|
3
|
+
import test, { before, describe } from 'node:test';
|
|
4
|
+
import {
|
|
5
|
+
modulesUrl,
|
|
6
|
+
bodyCreateTransaction,
|
|
7
|
+
} from '@cloudcommerce/test-base';
|
|
8
|
+
|
|
9
|
+
describe('Test to create a transaction in the loyalty points app', async () => {
|
|
10
|
+
let req;
|
|
11
|
+
let data;
|
|
12
|
+
const appId = 124890;
|
|
13
|
+
before(async () => {
|
|
14
|
+
const paymentMethod = {
|
|
15
|
+
code: 'loyalty_points',
|
|
16
|
+
};
|
|
17
|
+
bodyCreateTransaction.payment_method = paymentMethod;
|
|
18
|
+
|
|
19
|
+
req = await fetch(`${modulesUrl}/create_transaction?app_id=${appId}`, {
|
|
20
|
+
method: 'POST',
|
|
21
|
+
body: JSON.stringify(bodyCreateTransaction),
|
|
22
|
+
headers: {
|
|
23
|
+
'Content-Type': 'application/json',
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
data = (await req.json()).result;
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test('Check Status 200', async () => {
|
|
31
|
+
assert.strictEqual(req?.status, 200);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test('Check validated is true', async () => {
|
|
35
|
+
assert.equal(data[0].validated, true);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test('Have transaction', async () => {
|
|
39
|
+
assert.notEqual(data[0].response.transaction, undefined);
|
|
40
|
+
});
|
|
41
|
+
});
|