diff --git a/Packages/Weblog/Sources/Weblog/Fixtures/EditorViewModelMother.swift b/Packages/Weblog/Sources/Weblog/Fixtures/EditorViewModelMother.swift index 0ef32e3..79a74c4 100644 --- a/Packages/Weblog/Sources/Weblog/Fixtures/EditorViewModelMother.swift +++ b/Packages/Weblog/Sources/Weblog/Fixtures/EditorViewModelMother.swift @@ -7,14 +7,17 @@ // MARK: - Public @MainActor - static func makeEditorViewModel() -> EditorViewModel { + static func makeEditorViewModel( + status: WeblogEntryStatus = .draft, + tags: [String] = [] + ) -> EditorViewModel { .init( address: "alice", body: "# This is the title\n\nThis is the body...", date: .init(), entryID: nil, - status: .draft, - tags: .init(), + status: status, + tags: tags, repository: WeblogRepositoryMother.makeWeblogRepository() ) } diff --git a/Packages/Weblog/Sources/Weblog/Views/Editor/EditorView.swift b/Packages/Weblog/Sources/Weblog/Views/Editor/EditorView.swift index 87e4b0d..cbf3e59 100644 --- a/Packages/Weblog/Sources/Weblog/Views/Editor/EditorView.swift +++ b/Packages/Weblog/Sources/Weblog/Views/Editor/EditorView.swift @@ -28,7 +28,6 @@ struct EditorView: View { makeComposeView() makeSidebarView() } - makeSelectedTagsView() } .toolbar { @@ -191,10 +190,19 @@ struct EditorView: View { #if DEBUG - #Preview(traits: .sizeThatFitsLayout) { + #Preview("Draft", traits: .sizeThatFitsLayout) { EditorView( viewModel: EditorViewModelMother.makeEditorViewModel() ) } + #Preview("Live with Tags", traits: .sizeThatFitsLayout) { + EditorView( + viewModel: EditorViewModelMother.makeEditorViewModel( + status: .live, + tags: ["Foo", "Bar"] + ) + ) + } + #endif