Fix UI tests: remove tab content accessibility identifiers that override child identifiers
The .accessibilityIdentifier() on TabView tab content propagated to ALL child views in the accessibility tree, overriding identifiers like mood_header and settings_header. Tab buttons are already accessible via labels (Day, Month, etc.) so these aren't needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -28,31 +28,26 @@ struct MainTabView: View {
|
|||||||
.tabItem {
|
.tabItem {
|
||||||
Label(String(localized: "content_view_tab_main"), systemImage: "list.dash")
|
Label(String(localized: "content_view_tab_main"), systemImage: "list.dash")
|
||||||
}
|
}
|
||||||
.accessibilityIdentifier(AccessibilityID.Tab.day)
|
|
||||||
|
|
||||||
monthView
|
monthView
|
||||||
.tabItem {
|
.tabItem {
|
||||||
Label(String(localized: "content_view_tab_month"), systemImage: "calendar")
|
Label(String(localized: "content_view_tab_month"), systemImage: "calendar")
|
||||||
}
|
}
|
||||||
.accessibilityIdentifier(AccessibilityID.Tab.month)
|
|
||||||
|
|
||||||
yearView
|
yearView
|
||||||
.tabItem {
|
.tabItem {
|
||||||
Label(String(localized: "content_view_tab_filter"), systemImage: "line.3.horizontal.decrease.circle")
|
Label(String(localized: "content_view_tab_filter"), systemImage: "line.3.horizontal.decrease.circle")
|
||||||
}
|
}
|
||||||
.accessibilityIdentifier(AccessibilityID.Tab.year)
|
|
||||||
|
|
||||||
insightsView
|
insightsView
|
||||||
.tabItem {
|
.tabItem {
|
||||||
Label(String(localized: "content_view_tab_insights"), systemImage: "lightbulb.fill")
|
Label(String(localized: "content_view_tab_insights"), systemImage: "lightbulb.fill")
|
||||||
}
|
}
|
||||||
.accessibilityIdentifier(AccessibilityID.Tab.insights)
|
|
||||||
|
|
||||||
SettingsTabView()
|
SettingsTabView()
|
||||||
.tabItem {
|
.tabItem {
|
||||||
Label("Settings", systemImage: "gear")
|
Label("Settings", systemImage: "gear")
|
||||||
}
|
}
|
||||||
.accessibilityIdentifier(AccessibilityID.Tab.settings)
|
|
||||||
}
|
}
|
||||||
.accentColor(textColor)
|
.accentColor(textColor)
|
||||||
.sheet(isPresented: $needsOnboarding, onDismiss: { }, content: {
|
.sheet(isPresented: $needsOnboarding, onDismiss: { }, content: {
|
||||||
|
|||||||
Reference in New Issue
Block a user