fix tests
This commit is contained in:
parent
ba22646c22
commit
97929c07d6
@ -49,18 +49,7 @@ describe("Test wrapText", () => {
|
|||||||
{
|
{
|
||||||
desc: "break all characters when width of each character is less than container width",
|
desc: "break all characters when width of each character is less than container width",
|
||||||
width: 25,
|
width: 25,
|
||||||
res: `H
|
res: `H\ne\nl\nl\no \nw\nh\na\nt\ns \nu\np`,
|
||||||
e
|
|
||||||
l
|
|
||||||
l
|
|
||||||
o
|
|
||||||
w
|
|
||||||
h
|
|
||||||
a
|
|
||||||
t
|
|
||||||
s
|
|
||||||
u
|
|
||||||
p`,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "break words as per the width",
|
desc: "break words as per the width",
|
||||||
@ -90,8 +79,7 @@ up`,
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("When text contain new lines", () => {
|
describe("When text contain new lines", () => {
|
||||||
const text = `Hello
|
const text = "Hello\nwhats up";
|
||||||
whats up`;
|
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
desc: "break all words when width of each word is less than container width",
|
desc: "break all words when width of each word is less than container width",
|
||||||
@ -101,18 +89,7 @@ whats up`;
|
|||||||
{
|
{
|
||||||
desc: "break all characters when width of each character is less than container width",
|
desc: "break all characters when width of each character is less than container width",
|
||||||
width: 25,
|
width: 25,
|
||||||
res: `H
|
res: `H\ne\nl\nl\no\nw\nh\na\nt\ns \nu\np`,
|
||||||
e
|
|
||||||
l
|
|
||||||
l
|
|
||||||
o
|
|
||||||
w
|
|
||||||
h
|
|
||||||
a
|
|
||||||
t
|
|
||||||
s
|
|
||||||
u
|
|
||||||
p`,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "break words as per the width",
|
desc: "break words as per the width",
|
||||||
@ -149,13 +126,7 @@ whats up`,
|
|||||||
desc: "fit characters of long string as per container width and break words as per the width",
|
desc: "fit characters of long string as per container width and break words as per the width",
|
||||||
|
|
||||||
width: 130,
|
width: 130,
|
||||||
res: `hellolongte
|
res: `hellolongte\nxtthisiswha\ntsupwithyou\nIamtypinggg\nggandtyping\ngg break it \nnow`,
|
||||||
xtthisiswha
|
|
||||||
tsupwithyou
|
|
||||||
Iamtypinggg
|
|
||||||
ggandtyping
|
|
||||||
gg break it
|
|
||||||
now`,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "fit the long text when container width is greater than text length and move the rest to next line",
|
desc: "fit the long text when container width is greater than text length and move the rest to next line",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user