|
1 |
| -import { Alignment } from "../../../src/libs/common/alignment.enum"; |
2 |
| -import { ContentBox } from "../../../src/libs/engine/layout_engine/builder/groups/content_box/content_box"; |
3 |
| -import { Direction } from "../../../src/libs/common/distribution.enum"; |
| 1 | +import { Alignment } from '../../../src/libs/common/alignment.enum' |
| 2 | +import { ContentBox } from '../../../src/libs/engine/layout_engine/builder/groups/content_box/content_box' |
| 3 | +import { Direction } from '../../../src/libs/common/distribution.enum' |
4 | 4 |
|
5 |
| -describe("Content Box", () => { |
6 |
| - describe("Row - Top Label", function () { |
| 5 | +describe('Content Box', () => { |
| 6 | + describe('Row - Top Label', function() { |
7 | 7 | const contentBox = new ContentBox(
|
8 | 8 | 25,
|
9 | 9 | 5,
|
10 | 10 | Direction.HORIZONTAL,
|
11 | 11 | Alignment.START,
|
12 | 12 | Alignment.START,
|
13 |
| - 5,()=>{},()=>{}, |
14 |
| - ); |
| 13 | + 5, () => { |
| 14 | + }, () => { |
| 15 | + }, |
| 16 | + ) |
15 | 17 |
|
16 |
| - it("Should initialize and update main length content box reference", async () => { |
17 |
| - contentBox.setWidth(100); |
| 18 | + it('Should initialize and update main length content box reference', async () => { |
| 19 | + contentBox.setWidth(100) |
18 | 20 |
|
19 |
| - expect(contentBox.getDimension().topLeft.x).toBe(5); |
20 |
| - expect(contentBox.getDimension().bottomRight.x).toBe(105); |
21 |
| - }); |
| 21 | + expect(contentBox.getDimension().getLeftBoundary()).toBe(5) |
| 22 | + expect(contentBox.getDimension().getRightBoundary()).toBe(105) |
| 23 | + }) |
22 | 24 |
|
23 |
| - it("Should initialize and update cross length content box reference", async () => { |
24 |
| - contentBox.setHeight(100); |
| 25 | + it('Should initialize and update cross length content box reference', async () => { |
| 26 | + contentBox.setHeight(100) |
25 | 27 |
|
26 |
| - expect(contentBox.getDimension().topLeft.y).toBe(25); |
27 |
| - expect(contentBox.getDimension().bottomRight.y).toBe(125); |
28 |
| - }); |
29 |
| - }); |
| 28 | + expect(contentBox.getDimension().getTopBoundary()).toBe(25) |
| 29 | + expect(contentBox.getDimension().getBottomBoundary()).toBe(125) |
| 30 | + }) |
| 31 | + }) |
30 | 32 |
|
31 |
| - describe("Row - Lateral Label", function () { |
| 33 | + describe('Row - Lateral Label', function() { |
32 | 34 | const contentBox = new ContentBox(
|
33 | 35 | 5,
|
34 | 36 | 45,
|
35 | 37 | Direction.HORIZONTAL,
|
36 | 38 | Alignment.START,
|
37 | 39 | Alignment.START,
|
38 |
| - 5,()=>{},()=>{}, |
39 |
| - ); |
| 40 | + 5, () => { |
| 41 | + }, () => { |
| 42 | + }, |
| 43 | + ) |
40 | 44 |
|
41 |
| - it("Should initialize and update main length content box reference", async () => { |
42 |
| - contentBox.setWidth(100); |
| 45 | + it('Should initialize and update main length content box reference', async () => { |
| 46 | + contentBox.setWidth(100) |
43 | 47 |
|
44 |
| - expect(contentBox.getDimension().topLeft.x).toBe(45); |
45 |
| - expect(contentBox.getDimension().bottomRight.x).toBe(145); |
46 |
| - }); |
| 48 | + expect(contentBox.getDimension().getLeftBoundary()).toBe(45) |
| 49 | + expect(contentBox.getDimension().getRightBoundary()).toBe(145) |
| 50 | + }) |
47 | 51 |
|
48 |
| - it("Should initialize and update cross length content box reference", async () => { |
49 |
| - contentBox.setHeight(100); |
| 52 | + it('Should initialize and update cross length content box reference', async () => { |
| 53 | + contentBox.setHeight(100) |
50 | 54 |
|
51 |
| - expect(contentBox.getDimension().topLeft.y).toBe(5); |
52 |
| - expect(contentBox.getDimension().bottomRight.y).toBe(105); |
53 |
| - }); |
54 |
| - }); |
| 55 | + expect(contentBox.getDimension().getTopBoundary()).toBe(5) |
| 56 | + expect(contentBox.getDimension().getBottomBoundary()).toBe(105) |
| 57 | + }) |
| 58 | + }) |
55 | 59 |
|
56 |
| - describe("Col - Top Label", function () { |
| 60 | + describe('Col - Top Label', function() { |
57 | 61 | const contentBox = new ContentBox(
|
58 | 62 | 25,
|
59 | 63 | 5,
|
60 | 64 | Direction.VERTICAL,
|
61 | 65 | Alignment.START,
|
62 | 66 | Alignment.START,
|
63 |
| - 5,()=>{},()=>{}, |
64 |
| - ); |
| 67 | + 5, () => { |
| 68 | + }, () => { |
| 69 | + }, |
| 70 | + ) |
65 | 71 |
|
66 |
| - it("Should initialize and update main length content box reference", async () => { |
67 |
| - contentBox.setWidth(100); |
| 72 | + it('Should initialize and update main length content box reference', async () => { |
| 73 | + contentBox.setWidth(100) |
68 | 74 |
|
69 |
| - expect(contentBox.getDimension().topLeft.x).toBe(5); |
70 |
| - expect(contentBox.getDimension().bottomRight.x).toBe(105); |
71 |
| - }); |
| 75 | + expect(contentBox.getDimension().getLeftBoundary()).toBe(5) |
| 76 | + expect(contentBox.getDimension().getRightBoundary()).toBe(105) |
| 77 | + }) |
72 | 78 |
|
73 |
| - it("Should initialize and update cross length content box reference", async () => { |
74 |
| - contentBox.setHeight(100); |
| 79 | + it('Should initialize and update cross length content box reference', async () => { |
| 80 | + contentBox.setHeight(100) |
75 | 81 |
|
76 |
| - expect(contentBox.getDimension().topLeft.y).toBe(25); |
77 |
| - expect(contentBox.getDimension().bottomRight.y).toBe(125); |
78 |
| - }); |
79 |
| - }); |
| 82 | + expect(contentBox.getDimension().getTopBoundary()).toBe(25) |
| 83 | + expect(contentBox.getDimension().getBottomBoundary()).toBe(125) |
| 84 | + }) |
| 85 | + }) |
80 | 86 |
|
81 |
| - describe("Col - Lateral Label", function () { |
| 87 | + describe('Col - Lateral Label', function() { |
82 | 88 | const contentBox = new ContentBox(
|
83 | 89 | 5,
|
84 | 90 | 45,
|
85 | 91 | Direction.HORIZONTAL,
|
86 | 92 | Alignment.START,
|
87 | 93 | Alignment.START,
|
88 | 94 | 5,
|
89 |
| - () => {}, |
90 |
| - () => {} |
91 |
| - ); |
92 |
| - |
93 |
| - it("Should initialize and update main length content box reference", async () => { |
94 |
| - contentBox.setWidth(100); |
95 |
| - |
96 |
| - expect(contentBox.getDimension().topLeft.x).toBe(45); |
97 |
| - expect(contentBox.getDimension().bottomRight.x).toBe(145); |
98 |
| - }); |
99 |
| - |
100 |
| - it("Should initialize and update cross length content box reference", async () => { |
101 |
| - contentBox.setHeight(100); |
102 |
| - |
103 |
| - expect(contentBox.getDimension().topLeft.y).toBe(5); |
104 |
| - expect(contentBox.getDimension().bottomRight.y).toBe(105); |
105 |
| - }); |
106 |
| - }); |
107 |
| -}); |
| 95 | + () => { |
| 96 | + }, |
| 97 | + () => { |
| 98 | + }, |
| 99 | + ) |
| 100 | + |
| 101 | + it('Should initialize and update main length content box reference', async () => { |
| 102 | + contentBox.setWidth(100) |
| 103 | + |
| 104 | + expect(contentBox.getDimension().getLeftBoundary()).toBe(45) |
| 105 | + expect(contentBox.getDimension().getRightBoundary()).toBe(145) |
| 106 | + }) |
| 107 | + |
| 108 | + it('Should initialize and update cross length content box reference', async () => { |
| 109 | + contentBox.setHeight(100) |
| 110 | + |
| 111 | + expect(contentBox.getDimension().getTopBoundary()).toBe(5) |
| 112 | + expect(contentBox.getDimension().getBottomBoundary()).toBe(105) |
| 113 | + }) |
| 114 | + }) |
| 115 | +}) |
0 commit comments