Skip to content

Commit 5b54303

Browse files
committed
Fix polls background view not using correct color from palette (#667)
* Record dark mode tests in create poll view * Fix Poll Creation View background color * Fix Poll Results background
1 parent a90073d commit 5b54303

File tree

33 files changed

+15
-15
lines changed

33 files changed

+15
-15
lines changed

β€ŽSources/StreamChatSwiftUI/ChatChannel/MessageList/Polls/PollResultsView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ struct PollResultsView: View {
5555
Spacer()
5656
}
5757
}
58-
.background(Color(colors.background8).ignoresSafeArea())
58+
.background(Color(colors.background).ignoresSafeArea())
5959
.toolbar {
6060
ToolbarItem(placement: .principal) {
6161
Text(L10n.Message.Polls.Toolbar.resultsTitle)

β€ŽSources/StreamChatSwiftUI/ChatChannel/Polls/CreatePollView.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ struct CreatePollView: View {
162162
Spacer()
163163
.modifier(ListRowModifier())
164164
}
165-
.background(Color(colors.background8).ignoresSafeArea())
165+
.background(Color(colors.background).ignoresSafeArea())
166166
.listStyle(.plain)
167167
.id(listId)
168168
.toolbar {
@@ -237,7 +237,7 @@ struct ListRowModifier: ViewModifier {
237237
if #available(iOS 15.0, *) {
238238
content
239239
.listRowSeparator(.hidden)
240-
.listRowBackground(Color(colors.background8))
240+
.listRowBackground(Color(colors.background))
241241
} else {
242242
content
243243
}

β€ŽStreamChatSwiftUITests/Tests/ChatChannel/CreatePollView_Tests.swift

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ final class CreatePollView_Tests: StreamChatTestCase {
1919
.applyDefaultSize()
2020

2121
// Then
22-
assertSnapshot(matching: view, as: .image)
22+
AssertSnapshot(view, variants: .onlyUserInterfaceStyles)
2323
}
24-
24+
2525
func test_createPollView_allOptionsDisabledSnapshot() {
2626
// Given
2727
let hidden = PollsEntryConfig(configurable: false, defaultValue: false)
@@ -38,7 +38,7 @@ final class CreatePollView_Tests: StreamChatTestCase {
3838
.applyDefaultSize()
3939

4040
// Then
41-
assertSnapshot(matching: view, as: .image)
41+
AssertSnapshot(view, variants: .onlyUserInterfaceStyles)
4242
}
4343

4444
func test_createPollView_allOptionsEnabledSnapshot() {
@@ -58,7 +58,7 @@ final class CreatePollView_Tests: StreamChatTestCase {
5858
.applyDefaultSize()
5959

6060
// Then
61-
assertSnapshot(matching: view, as: .image)
61+
AssertSnapshot(view, variants: .onlyUserInterfaceStyles)
6262
}
6363

6464
func test_createPollView_mixedOptionsSnapshot() {
@@ -81,6 +81,6 @@ final class CreatePollView_Tests: StreamChatTestCase {
8181
.applyDefaultSize()
8282

8383
// Then
84-
assertSnapshot(matching: view, as: .image)
84+
AssertSnapshot(view, variants: .onlyUserInterfaceStyles)
8585
}
8686
}

β€ŽStreamChatSwiftUITests/Tests/ChatChannel/PollAttachmentView_Tests.swift

+7-7
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ final class PollAttachmentView_Tests: StreamChatTestCase {
3131
.frame(width: defaultScreenSize.width, height: 240)
3232

3333
// Then
34-
assertSnapshot(matching: view, as: .image)
34+
AssertSnapshot(view, variants: .onlyUserInterfaceStyles)
3535
}
3636

3737
func test_pollAttachmentView_snapshotUniqueVotes() {
@@ -59,7 +59,7 @@ final class PollAttachmentView_Tests: StreamChatTestCase {
5959
.frame(width: defaultScreenSize.width, height: 150)
6060

6161
// Then
62-
assertSnapshot(matching: view, as: .image)
62+
AssertSnapshot(view, variants: .onlyUserInterfaceStyles)
6363
}
6464

6565
func test_pollAttachmentView_closedPoll() {
@@ -88,7 +88,7 @@ final class PollAttachmentView_Tests: StreamChatTestCase {
8888
.frame(width: defaultScreenSize.width, height: 150)
8989

9090
// Then
91-
assertSnapshot(matching: view, as: .image)
91+
AssertSnapshot(view, variants: .onlyUserInterfaceStyles)
9292
}
9393

9494
func test_pollAttachmentView_resultsSnapshot() {
@@ -101,7 +101,7 @@ final class PollAttachmentView_Tests: StreamChatTestCase {
101101
.applyDefaultSize()
102102

103103
// Then
104-
assertSnapshot(matching: view, as: .image)
104+
AssertSnapshot(view, variants: .onlyUserInterfaceStyles)
105105
}
106106

107107
func test_pollAttachmentView_allOptions() {
@@ -114,7 +114,7 @@ final class PollAttachmentView_Tests: StreamChatTestCase {
114114
.applyDefaultSize()
115115

116116
// Then
117-
assertSnapshot(matching: view, as: .image)
117+
AssertSnapshot(view, variants: .onlyUserInterfaceStyles)
118118
}
119119

120120
func test_pollAttachmentView_allVotes() {
@@ -126,7 +126,7 @@ final class PollAttachmentView_Tests: StreamChatTestCase {
126126
.applyDefaultSize()
127127

128128
// Then
129-
assertSnapshot(matching: view, as: .image)
129+
AssertSnapshot(view, variants: .onlyUserInterfaceStyles)
130130
}
131131

132132
func test_pollAttachmentView_allComments() {
@@ -145,6 +145,6 @@ final class PollAttachmentView_Tests: StreamChatTestCase {
145145
.applyDefaultSize()
146146

147147
// Then
148-
assertSnapshot(matching: view, as: .image)
148+
AssertSnapshot(view, variants: .onlyUserInterfaceStyles)
149149
}
150150
}

0 commit comments

Comments
Β (0)