Skip to content

Add custom fn page render test #7802

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,12 @@ export const CodeMirror = forwardRef(function _CodeMirror(

return (
<div className="editor-wrapper" style={style}>
<div data-ci="codemirror-editor" className="editor" ref={setTextarea} />
<div
data-ci="codemirror-editor"
id="bootcamp-cm-editor"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this neccesary? I don't see it used anywhere in this PR

Copy link
Member Author

@dem4ron dem4ron May 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, another test is failing because #bootcamp-cm-editor is missing. I accidentally removed it, thinking we no longer used it anywhere.

className="editor"
ref={setTextarea}
/>
</div>
)
})
2 changes: 1 addition & 1 deletion app/views/bootcamp/custom_functions/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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!
27 changes: 27 additions & 0 deletions test/system/bootcamp/custom_functions_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
require_relative "base_test"

module Bootcamp
class CustomFunctionsTest < BaseTest
test "custom function editor page renders" 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
Loading