From 45426edd64ce0c19f76dbc8b874fad9b3ff1b2c1 Mon Sep 17 00:00:00 2001 From: Jeff Verkoeyen Date: Thu, 1 Aug 2024 15:39:16 -0400 Subject: [PATCH] Add state tests and move Text tests into a sub-directory. --- Tests/SlipstreamTests/StateTests.swift | 17 +++++++++++++++++ .../TextInputAndOutput}/TextTests.swift | 0 2 files changed, 17 insertions(+) create mode 100644 Tests/SlipstreamTests/StateTests.swift rename Tests/SlipstreamTests/{ => Views/TextInputAndOutput}/TextTests.swift (100%) diff --git a/Tests/SlipstreamTests/StateTests.swift b/Tests/SlipstreamTests/StateTests.swift new file mode 100644 index 0000000..14c63eb --- /dev/null +++ b/Tests/SlipstreamTests/StateTests.swift @@ -0,0 +1,17 @@ +import Testing + +import Slipstream + +private struct StateView: View { + let string: String + var body: some View { + Text(string) + } +} + +struct StateTests { + @Test func rendersProvidedString() throws { + try #expect(renderHTML(StateView(string: "Hello, world!")) == "Hello, world!") + try #expect(renderHTML(StateView(string: "Slipstream")) == "Slipstream") + } +} diff --git a/Tests/SlipstreamTests/TextTests.swift b/Tests/SlipstreamTests/Views/TextInputAndOutput/TextTests.swift similarity index 100% rename from Tests/SlipstreamTests/TextTests.swift rename to Tests/SlipstreamTests/Views/TextInputAndOutput/TextTests.swift