feat: add unit tests for models and ListStore and UI test for adding a todo

This commit is contained in:
2026-03-04 19:14:23 +01:00
parent 680320784f
commit 76bba19959
3 changed files with 196 additions and 1 deletions

View File

@@ -7,7 +7,11 @@ struct MindDumpApp: App {
@State private var store: ListStore
init() {
let container = try! ModelContainer(for: TodoList.self, TodoItem.self)
let isUITest = ProcessInfo.processInfo.arguments.contains("UI_TESTING")
let config = isUITest
? ModelConfiguration(isStoredInMemoryOnly: true)
: ModelConfiguration()
let container = try! ModelContainer(for: TodoList.self, TodoItem.self, configurations: config)
self.container = container
self._store = State(initialValue: ListStore(modelContext: container.mainContext))
}