1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-08 22:40:59 +00:00

test(core/ui): fix Rust paragraph splitting unit tests on T3T1

This commit is contained in:
matejcik 2024-05-31 11:36:35 +02:00 committed by matejcik
parent 8620ab5766
commit dd0fe3d878
2 changed files with 29 additions and 25 deletions

View File

@ -595,7 +595,7 @@ mod tests {
), ),
Paragraph::new( Paragraph::new(
&theme::TEXT_BOLD, &theme::TEXT_BOLD,
"Second, bold, paragraph should also fit on the screen whole I think.", "Second, bold, paragraph should also fit on the screen.",
), ),
]), ]),
theme::BG, theme::BG,
@ -610,7 +610,7 @@ mod tests {
"component": "Paragraphs", "component": "Paragraphs",
"paragraphs": [ "paragraphs": [
["This is the first", "\n", "paragraph and it should", "\n", "fit on the screen", "\n", "entirely."], ["This is the first", "\n", "paragraph and it should", "\n", "fit on the screen", "\n", "entirely."],
["Second, bold, paragraph", "\n", "should also fit on the", "\n", "screen whole I think."], ["Second, bold,", "\n", "paragraph should also", "\n", "fit on the screen."],
], ],
}, },
"hold": false, "hold": false,
@ -645,13 +645,12 @@ mod tests {
"paragraphs": [ "paragraphs": [
[ [
"This is somewhat long", "\n", "This is somewhat long", "\n",
"paragraph that goes on", "\n", "paragraph that goes", "\n",
"and on and on and on and", "\n", "on and on and on and", "\n",
"on and will definitely not", "\n", "on and on and will", "\n",
"fit on just a single", "\n", "definitely not fit on", "\n",
"screen. You have to", "\n", "just a single screen.", "\n",
"swipe a bit to see all the", "\n", "You have to swipe a", "...",
"text it contains I guess.", "...",
], ],
], ],
}, },
@ -664,7 +663,12 @@ mod tests {
"content": { "content": {
"component": "Paragraphs", "component": "Paragraphs",
"paragraphs": [ "paragraphs": [
["There's just so much", "\n", "letters in it."], [
"bit to see all the text it", "\n",
"contains I guess.", "\n",
"There's just so much", "\n",
"letters in it."
],
], ],
}, },
"hold": false, "hold": false,
@ -710,15 +714,15 @@ mod tests {
"component": "Paragraphs", "component": "Paragraphs",
"paragraphs": [ "paragraphs": [
[ [
"This paragraph is using a", "\n", "This paragraph is", "\n",
"bold font. It doesn't need", "\n", "using a bold font. It", "\n",
"to be all that long.", "doesn't need to be all", "\n",
"that long.",
], ],
[ [
"And this one is u", "\n", "And this one is u", "\n",
"sing MONO. Monosp", "\n", "sing MONO. Monosp", "\n",
"ace is nice for n", "\n", "ace is nice f", "...",
"umbers, they", "...",
], ],
], ],
}, },
@ -732,15 +736,13 @@ mod tests {
"component": "Paragraphs", "component": "Paragraphs",
"paragraphs": [ "paragraphs": [
[ [
"...", "have the same", "\n", "...", "or numbers, t", "\n",
"hey have the same", "\n",
"width and can be", "\n", "width and can be", "\n",
"scanned quickly.", "\n", "scanned quickly.", "\n",
"Even if they span", "\n", "Even if they span", "\n",
"several pages or", "\n", "several pages or", "\n",
"something.", "something."
],
[
"Let's add another one", "...",
], ],
], ],
}, },
@ -754,10 +756,12 @@ mod tests {
"component": "Paragraphs", "component": "Paragraphs",
"paragraphs": [ "paragraphs": [
[ [
"for a good measure. This", "\n", "Let's add another one", "\n",
"one should overflow all", "\n", "for a good measure.", "\n",
"the way to the third page", "\n", "This one should", "\n",
"with a bit of luck.", "overflow all the way to", "\n",
"the third page with a", "\n",
"bit of luck.",
], ],
], ],
}, },

View File

@ -2039,7 +2039,7 @@ mod tests {
"content": { "content": {
"component": "FormattedText", "component": "FormattedText",
"text": ["Testing text layout, with", "\n", "some text, and some", "\n", "text": ["Testing text layout, with", "\n", "some text, and some", "\n",
"more text. And ", "paramet", "-", "\n", "ers!"], "more text. And ", "parame", "-", "\n", "ters!"],
"fits": true, "fits": true,
}, },
"controls": { "controls": {