Skip to content

Commit fe2ceac

Browse files
committed
Add basic test that Monaco is hooked up
1 parent aee0bf2 commit fe2ceac

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/spec/features/editor_types_spec.rb

+25
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,29 @@ def simple_editor_code
2525
}
2626
EOF
2727
end
28+
29+
scenario "using the Monaco editor" do
30+
in_config_menu { select("monaco") }
31+
32+
editor = page.find('.monaco-editor')
33+
34+
# Click on the last line as that will replace the entire content
35+
editor.find('.view-line:last-child').click
36+
t = editor.find('textarea', visible: false)
37+
t.set(monaco_editor_code, clear: :backspace)
38+
39+
click_on("Run")
40+
41+
within(:output, :stdout) do
42+
expect(page).to have_content 'Monaco editor'
43+
end
44+
end
45+
46+
# Missing indentation and closing curly braces as those are auto-inserted
47+
def monaco_editor_code
48+
<<~EOF
49+
fn main() {
50+
println!("Using the Monaco editor");
51+
EOF
52+
end
2853
end

0 commit comments

Comments
 (0)