From 77fc4441574b0460eb89f63d493b379784054ac5 Mon Sep 17 00:00:00 2001 From: Christian Beer Date: Tue, 15 Mar 2022 17:46:23 +0100 Subject: [PATCH] Test for table with headers and cells --- Tests/PlotTests/HTMLComponentTests.swift | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Tests/PlotTests/HTMLComponentTests.swift b/Tests/PlotTests/HTMLComponentTests.swift index 42dd660..0958d14 100644 --- a/Tests/PlotTests/HTMLComponentTests.swift +++ b/Tests/PlotTests/HTMLComponentTests.swift @@ -572,4 +572,26 @@ final class HTMLComponentTests: XCTestCase { """) } + + func testTableWithHeadersAndCells() { + let html = Table { + TableRow { + TableHeaderCell("Header one") + TableHeaderCell("Header two") + } + + TableRow { + TableCell("Cell one") + TableCell("Cell two") + } + } + .render() + + XCTAssertEqual(html, """ + \ + \ + \ +
Header oneHeader two
Cell oneCell two
+ """) + } }