Add synced user notes
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
extends SceneTree
|
||||
|
||||
const NotesEditor := preload("res://scripts/ui/notes_editor.gd")
|
||||
const NotesDialog := preload("res://scripts/ui/notes_dialog.gd")
|
||||
const NavigationRoutes := preload("res://scripts/ui/navigation_routes.gd")
|
||||
|
||||
var failures := 0
|
||||
|
||||
|
||||
func _initialize() -> void:
|
||||
call_deferred("_run")
|
||||
|
||||
|
||||
func _run() -> void:
|
||||
var editor := NotesEditor.new()
|
||||
root.add_child(editor)
|
||||
await process_frame
|
||||
_assert(editor.editor != null, "notes editor should create a text editor")
|
||||
_assert(editor.editor.wrap_mode == TextEdit.LINE_WRAPPING_BOUNDARY, "notes should wrap plain text")
|
||||
_assert(NavigationRoutes.key_for_screen("notes") == "notes", "notes should have a navigation route")
|
||||
|
||||
var dialog := NotesDialog.new()
|
||||
root.add_child(dialog)
|
||||
await process_frame
|
||||
_assert(not dialog.visible, "notes dialog should start hidden")
|
||||
_assert(dialog.notes_editor != null, "notes dialog should contain the shared editor")
|
||||
|
||||
editor.queue_free()
|
||||
dialog.queue_free()
|
||||
quit(1 if failures > 0 else 0)
|
||||
|
||||
|
||||
func _assert(condition: bool, message: String) -> void:
|
||||
if condition:
|
||||
return
|
||||
failures += 1
|
||||
push_error(message)
|
||||
Reference in New Issue
Block a user