// // EmptyStateTests.swift // Tests iOS // // Empty state display tests. // import XCTest final class EmptyStateTests: BaseUITestCase { override var seedFixture: String? { "empty" } /// TC-020: With no entries, the empty state should display without crashing. func testEmptyState_ShowsNoDataMessage() { // The app should show either the mood header (voting prompt) or // the empty state text. Either way, it should not crash. let moodHeader = app.otherElements["mood_header"] let noDataText = app.staticTexts["empty_state_no_data"] // At least one of these should be visible let headerExists = moodHeader.waitForExistence(timeout: 5) let noDataExists = noDataText.waitForExistence(timeout: 2) XCTAssertTrue( headerExists || noDataExists, "Either mood header or 'no data' text should be visible in empty state" ) // No entry rows should exist let entryRows = app.descendants(matching: .any) .matching(NSPredicate(format: "identifier BEGINSWITH %@", "entry_row_")) .firstMatch XCTAssertFalse( entryRows.waitForExistence(timeout: 2), "No entry rows should exist in empty state" ) captureScreenshot(name: "empty_state") } }