Skip to content

Commit e32fd1f

Browse files
committed
chore(test): style table border & font size (#77)
1 parent af7d858 commit e32fd1f

File tree

1 file changed

+82
-3
lines changed

1 file changed

+82
-3
lines changed

__tests__/modify-existing-table-format-cell.test.ts

Lines changed: 82 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,107 @@ test('Add and modify an existing table, apply styles to cell.', async () => {
2222
},
2323
isItalics: true,
2424
isBold: true,
25+
size: 1200,
2526
},
2627
],
2728
},
28-
{ values: ['test2', 12, 18, 15, 12] },
2929
{
30-
values: ['test3', 14, 12, 11, 14],
30+
values: ['test2', 12, 18, 15, 12],
3131
styles: [
3232
null,
3333
null,
3434
null,
3535
null,
36+
{
37+
// If you want to style a cell border, you
38+
// need to style adjacent borders as well:
39+
border: [
40+
{
41+
// This is required to complete top border
42+
// of adjacent cell in row below:
43+
tag: 'lnB',
44+
type: 'solid',
45+
weight: 5000,
46+
color: {
47+
type: 'srgbClr',
48+
value: '00FF00',
49+
},
50+
},
51+
],
52+
},
53+
],
54+
},
55+
{
56+
values: ['test3', 14, 12, 11, 14],
57+
styles: [
58+
null,
59+
null,
60+
null,
61+
{
62+
border: [
63+
{
64+
tag: 'lnR',
65+
type: 'solid',
66+
weight: 5000,
67+
color: {
68+
type: 'srgbClr',
69+
value: '00FF00',
70+
},
71+
},
72+
],
73+
},
3674
{
3775
color: {
3876
type: 'srgbClr',
3977
value: 'FF0000',
4078
},
4179
background: {
4280
type: 'srgbClr',
43-
value: '333333',
81+
value: 'ffffff',
4482
},
4583
isItalics: true,
4684
isBold: true,
85+
size: 600,
86+
border: [
87+
{
88+
// This will only work in case you style
89+
// adjacent cell in row above with 'lnB':
90+
tag: 'lnT',
91+
type: 'solid',
92+
weight: 5000,
93+
color: {
94+
type: 'srgbClr',
95+
value: '00FF00',
96+
},
97+
},
98+
{
99+
tag: 'lnB',
100+
type: 'solid',
101+
weight: 5000,
102+
color: {
103+
type: 'srgbClr',
104+
value: '00FF00',
105+
},
106+
},
107+
{
108+
tag: 'lnL',
109+
type: 'solid',
110+
weight: 5000,
111+
color: {
112+
type: 'srgbClr',
113+
value: '00FF00',
114+
},
115+
},
116+
{
117+
tag: 'lnR',
118+
type: 'solid',
119+
weight: 5000,
120+
color: {
121+
type: 'srgbClr',
122+
value: '00FF00',
123+
},
124+
},
125+
],
47126
},
48127
],
49128
},

0 commit comments

Comments
 (0)