Updates based on comments.

This commit is contained in:
David Langley
2022-10-13 11:12:14 +01:00
parent c73a3304ca
commit ca8467e7b0
7 changed files with 28 additions and 12 deletions
@@ -72,6 +72,23 @@ extension ComposerCreateAction {
}
}
var accessibilityIdentifier: String {
switch self {
case .photoLibrary:
return "photoLibraryAction"
case .stickers:
return "stickersAction"
case .attachments:
return "attachmentsAction"
case .polls:
return "pollsAction"
case .location:
return "locationAction"
case .camera:
return "cameraAction"
}
}
var icon: String {
switch self {
case .photoLibrary:
@@ -21,14 +21,14 @@ class ComposerCreateActionListUITests: MockScreenTestCase {
func testFullList() throws {
app.goToScreenWithIdentifier(MockComposerCreateActionListScreenState.fullList.title)
XCTAssert(app.staticTexts["Photo Library"].exists)
XCTAssert(app.staticTexts["Location"].exists)
XCTAssert(app.staticTexts[ComposerCreateAction.photoLibrary.accessibilityIdentifier].exists)
XCTAssert(app.staticTexts[ComposerCreateAction.location.accessibilityIdentifier].exists)
}
func testPartialList() throws {
app.goToScreenWithIdentifier(MockComposerCreateActionListScreenState.partialList.title)
XCTAssert(app.staticTexts["Photo Library"].exists)
XCTAssertFalse(app.staticTexts["Location"].exists)
XCTAssert(app.staticTexts[ComposerCreateAction.photoLibrary.accessibilityIdentifier].exists)
XCTAssertFalse(app.staticTexts[ComposerCreateAction.location.accessibilityIdentifier].exists)
}
}
@@ -38,6 +38,7 @@ struct ComposerCreateActionList: View {
Text(action.title)
.foregroundColor(theme.colors.primaryContent)
.font(theme.fonts.body)
.accessibilityIdentifier(action.accessibilityIdentifier)
Spacer()
}
.contentShape(Rectangle())
@@ -46,6 +47,7 @@ struct ComposerCreateActionList: View {
}
.padding(.horizontal, 16)
.padding(.vertical, 12)
}
}
.padding(.top, 16)