Update FormattedBodyText snapshots: cover more cases and use sizeThatFits layout

This commit is contained in:
Stefan Ceriu
2024-05-10 13:34:29 +03:00
committed by Stefan Ceriu
parent 099b69d2f2
commit 136ecb125c
9 changed files with 29 additions and 16 deletions
@@ -180,6 +180,15 @@ struct FormattedBodyText_Previews: PreviewProvider, TestablePreview {
@ViewBuilder @ViewBuilder
static var body: some View { static var body: some View {
let htmlStrings = [ let htmlStrings = [
"""
Plain text\n
@bob:matrix.org\n
#room:matrix.org\n
!room:matrix.org\n
https://www.matrix.org\n
www.matrix.org\n
matrix.org
""",
""" """
Text before blockquote Text before blockquote
<blockquote> <blockquote>
@@ -203,6 +212,8 @@ struct FormattedBodyText_Previews: PreviewProvider, TestablePreview {
<code><b>Hello</b> <i>world</i></code> <code><b>Hello</b> <i>world</i></code>
<p>Text</p> <p>Text</p>
<code>Hello world</code> <code>Hello world</code>
<p>Text</p>
<code><a href="https://www.matrix.org">matrix.org</a> https://www.matrix.org</code>
""", """,
"<p>This is a list</p>\n<ul>\n<li>One</li>\n<li>Two</li>\n<li>And number 3</li>\n</ul>\n", "<p>This is a list</p>\n<ul>\n<li>One</li>\n<li>Two</li>\n<li>And number 3</li>\n</ul>\n",
"<ul><li>First item</li><li>Second item</li><li>Third item</li></ul>", "<ul><li>First item</li><li>Second item</li><li>Third item</li></ul>",
@@ -231,6 +242,8 @@ struct FormattedBodyText_Previews: PreviewProvider, TestablePreview {
} }
.padding() .padding()
} }
.previewLayout(.sizeThatFits)
.snapshot(delay: 0.25)
} }
} }
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:f191a941a72c188c0c5acae75fbf57f36811671148adbcf13f512851340d54b5 oid sha256:9853554a8c876e6529ea95064381da54eeb4f8aa620ab17fd3ae0953924a71ae
size 295371 size 518698
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:3ee0af2b114075f166de919a12fbbf48a8731f12d52acdc5a156040ee62be6ba oid sha256:bb6e8561cdf4f242d1ea1321c5e9e7fa5e9804a5a31fe3f8997082399f3915a8
size 263615 size 464233
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:f191a941a72c188c0c5acae75fbf57f36811671148adbcf13f512851340d54b5 oid sha256:9853554a8c876e6529ea95064381da54eeb4f8aa620ab17fd3ae0953924a71ae
size 295371 size 518698
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:3ee0af2b114075f166de919a12fbbf48a8731f12d52acdc5a156040ee62be6ba oid sha256:bb6e8561cdf4f242d1ea1321c5e9e7fa5e9804a5a31fe3f8997082399f3915a8
size 263615 size 464233
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:3df0e6180622b278ac5caaab551edee73fda05cb1dcdf8558cceeff1acccd747 oid sha256:630c06c2eb40d8872603bd155b6fb2496b94136de28b810d9f39db751837bd33
size 213754 size 413694
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:893d06e44138bdced8c861acd6e9d66cd05c4aca8670efdc534a6ea30915414f oid sha256:0b0f8ce57b2b3646fbf5335dd7bc6a975efa8957db371ab247bfa2ce9ab2f338
size 194375 size 377090
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:3df0e6180622b278ac5caaab551edee73fda05cb1dcdf8558cceeff1acccd747 oid sha256:630c06c2eb40d8872603bd155b6fb2496b94136de28b810d9f39db751837bd33
size 213754 size 413694
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:893d06e44138bdced8c861acd6e9d66cd05c4aca8670efdc534a6ea30915414f oid sha256:0b0f8ce57b2b3646fbf5335dd7bc6a975efa8957db371ab247bfa2ce9ab2f338
size 194375 size 377090