From fc003ed99a5cbb9be3005ca5dfeb421be82b7e7d Mon Sep 17 00:00:00 2001 From: dem4ron Date: Thu, 1 May 2025 08:55:43 +0200 Subject: [PATCH 1/3] Add custom fn page render test --- .../bootcamp/custom_functions/index.html.haml | 2 +- test/system/bootcamp/custom_functions_test.rb | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 test/system/bootcamp/custom_functions_test.rb diff --git a/app/views/bootcamp/custom_functions/index.html.haml b/app/views/bootcamp/custom_functions/index.html.haml index 02701107df..6b2ef47470 100644 --- a/app/views/bootcamp/custom_functions/index.html.haml +++ b/app/views/bootcamp/custom_functions/index.html.haml @@ -44,6 +44,6 @@ %h3= fn.name %p= fn.description - = button_to bootcamp_custom_functions_path do + = button_to bootcamp_custom_functions_path, { id: "new-function-button" } do %h3 New Function %p Create a new function for whatever reusable code you feel is appropriate! diff --git a/test/system/bootcamp/custom_functions_test.rb b/test/system/bootcamp/custom_functions_test.rb new file mode 100644 index 0000000000..705cc0d7a5 --- /dev/null +++ b/test/system/bootcamp/custom_functions_test.rb @@ -0,0 +1,27 @@ +require_relative "base_test" + +module Bootcamp + class EditorTest < BaseTest + test "things render" do + user = create(:user, bootcamp_attendee: true) + + use_capybara_host do + sign_in!(user) + visit bootcamp_custom_functions_url + + find("#new-function-button").click + + assert_selector(".c-toggle-button") + assert_button("Dependencies") + assert_button("Save Changes") + assert_button("Delete") + assert_link("Close") + assert_button("Add new test") + assert_text("Function name") + assert_text("Description") + assert_text("Tests") + assert_button("Check code") + end + end + end +end From 3fe3f403ac889ec9ded26602c1a28b754ecacbf2 Mon Sep 17 00:00:00 2001 From: dem4ron Date: Thu, 1 May 2025 16:18:34 +0200 Subject: [PATCH 2/3] Adjust naming --- test/system/bootcamp/custom_functions_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/system/bootcamp/custom_functions_test.rb b/test/system/bootcamp/custom_functions_test.rb index 705cc0d7a5..61c76985a3 100644 --- a/test/system/bootcamp/custom_functions_test.rb +++ b/test/system/bootcamp/custom_functions_test.rb @@ -1,8 +1,8 @@ require_relative "base_test" module Bootcamp - class EditorTest < BaseTest - test "things render" do + class CustomFunctionsTest < BaseTest + test "custom function editor page renders" do user = create(:user, bootcamp_attendee: true) use_capybara_host do From bfc34230d8f80492fcec9b2064cb354998e20078 Mon Sep 17 00:00:00 2001 From: dem4ron Date: Thu, 1 May 2025 17:47:01 +0200 Subject: [PATCH 3/3] Add back removed codemirror id --- .../JikiscriptExercisePage/CodeMirror/CodeMirror.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/javascript/components/bootcamp/JikiscriptExercisePage/CodeMirror/CodeMirror.tsx b/app/javascript/components/bootcamp/JikiscriptExercisePage/CodeMirror/CodeMirror.tsx index b97b0dca7b..64c7955b73 100644 --- a/app/javascript/components/bootcamp/JikiscriptExercisePage/CodeMirror/CodeMirror.tsx +++ b/app/javascript/components/bootcamp/JikiscriptExercisePage/CodeMirror/CodeMirror.tsx @@ -321,7 +321,12 @@ export const CodeMirror = forwardRef(function _CodeMirror( return (
-
+
) })