laradumps-js 0.2.0 → 0.2.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.
@@ -1,42 +0,0 @@
1
- const {default: Table} = require("../Table");
2
-
3
- describe.only('Table', () => {
4
- const users = [
5
- {"name": "hecktor"},
6
- {"name": "luan"},
7
- ];
8
-
9
- it('should be able to send table', () => {
10
- Table.label = jest.fn();
11
- Table.send = jest.fn().mockReturnValue({label: Table.label});
12
-
13
- Table.table(users, "test");
14
-
15
- expect(Table.send).toHaveBeenCalledWith("table", {
16
- "table": {
17
- fields: ["name"],
18
- header: ["name"],
19
- values: users,
20
- label: "test"
21
- }
22
- });
23
-
24
- expect(Table.label).toHaveBeenCalledWith("test");
25
- });
26
-
27
- it('should be able to send table v2', () => {
28
- Table.label = jest.fn();
29
- Table.send = jest.fn().mockReturnValue({label: Table.label});
30
-
31
- Table.tableV2(users, "test");
32
-
33
- expect(Table.send).toHaveBeenCalledWith("table_v2", {
34
- "table_v2": {
35
- label: "test",
36
- values: users
37
- }
38
- });
39
-
40
- expect(Table.label).toHaveBeenCalledWith("test");
41
- });
42
- });
@@ -1,35 +0,0 @@
1
- const {default: TimeTrack} = require("../TimeTrack");
2
-
3
- describe('TimeTrack', () => {
4
- TimeTrack.makeUUID = jest.fn().mockReturnValue("test");
5
-
6
- it('should be able to send time track', () => {
7
- TimeTrack.label = jest.fn();
8
- TimeTrack.send = jest.fn().mockReturnValue({label: TimeTrack.label});
9
- TimeTrack.time('test');
10
-
11
- expect(TimeTrack.send).toHaveBeenCalledWith("time_track", {
12
- "time_track": {
13
- tracker_id: expect.any(String),
14
- time: expect.any(Number),
15
- label: "test"
16
- }
17
- });
18
-
19
- expect(TimeTrack.label).toHaveBeenCalledWith("test");
20
- });
21
-
22
- it('should be able to send time stop track', () => {
23
- TimeTrack.send = jest.fn();
24
- TimeTrack.stopTime('test');
25
-
26
- expect(TimeTrack.send).toHaveBeenCalledWith("time_track", {
27
- "time_track": {
28
- time: expect.any(Number),
29
- label: "test",
30
- end_time: expect.any(Number),
31
- tracker_id: expect.any(String)
32
- }
33
- });
34
- });
35
- })
@@ -1,40 +0,0 @@
1
- const {default: _Validate} = require("../Validate");
2
-
3
- describe('Validate', () => {
4
- it('should be able to send json validate', () => {
5
- _Validate.send = jest.fn();
6
- _Validate.isJson();
7
-
8
- expect(_Validate.send).toHaveBeenCalledWith("json_validate", {
9
- "json_validate": {}
10
- });
11
- });
12
-
13
- it('should be able to send validate', () => {
14
- _Validate.send = jest.fn();
15
- _Validate.validate('contains', 'test');
16
-
17
- expect(_Validate.send).toHaveBeenCalledWith("validate", {
18
- "validate": {
19
- type: "contains",
20
- content: "test",
21
- is_case_sensitive: false,
22
- is_whole_word: false
23
- }
24
- });
25
- });
26
-
27
- it('should be able to send contains', () => {
28
- _Validate.send = jest.fn();
29
- _Validate.contains('test');
30
-
31
- expect(_Validate.send).toHaveBeenCalledWith("validate", {
32
- "validate": {
33
- type: "contains",
34
- content: "test",
35
- is_case_sensitive: false,
36
- is_whole_word: false
37
- }
38
- });
39
- });
40
- });