Verify Custom LabelStyle
0.10.4To verify the label style applied to a view, use the .labelStyle() inspection method.
To inspect the components provided by a LabelStyle configuration, use the following helpers on the view hierarchy:
styleConfigurationTitle(index: Int)styleConfigurationIcon(index: Int)
// Verify label style type
XCTAssertTrue(try sut.inspect().labelStyle() is IconOnlyLabelStyle)
// Inspect LabelStyle configuration components
func testCustomLabelStyle() throws {
let sut = CustomLabelStyle()
let title = try sut.inspect().vStack().styleConfigurationTitle(0)
let icon = try sut.inspect().vStack().styleConfigurationIcon(1)
XCTAssertEqual(try title.blur().radius, 3)
XCTAssertEqual(try icon.padding(), EdgeInsets(top: 5, leading: 5, bottom: 5, trailing: 5))
}