kanbanworkflowstimelinescrumrubyroadmapproject-planningproject-managementopenprojectangularissue-trackerifcgantt-chartganttbug-trackerboardsbcf
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
901 B
46 lines
901 B
5 years ago
|
require_relative './edit_field'
|
||
9 years ago
|
|
||
5 years ago
|
class TextAreaField < EditField
|
||
9 years ago
|
|
||
|
def input_selector
|
||
|
'textarea'
|
||
|
end
|
||
|
|
||
9 years ago
|
def expect_save_button(enabled: true)
|
||
|
if enabled
|
||
7 years ago
|
expect(field_container).to have_no_selector("#{control_link}[disabled]")
|
||
9 years ago
|
else
|
||
7 years ago
|
expect(field_container).to have_selector("#{control_link}[disabled]")
|
||
9 years ago
|
end
|
||
|
end
|
||
|
|
||
9 years ago
|
def save!
|
||
|
submit_by_click
|
||
|
end
|
||
|
|
||
9 years ago
|
def submit_by_click
|
||
7 years ago
|
target = field_container.find(control_link)
|
||
8 years ago
|
scroll_to_element(target)
|
||
|
target.click
|
||
9 years ago
|
end
|
||
|
|
||
|
def submit_by_keyboard
|
||
|
input_element.native.send_keys :tab
|
||
|
end
|
||
|
|
||
|
def cancel_by_click
|
||
7 years ago
|
target = field_container.find(control_link(:cancel))
|
||
8 years ago
|
scroll_to_element(target)
|
||
|
target.click
|
||
9 years ago
|
end
|
||
|
|
||
|
def field_type
|
||
|
'textarea'
|
||
|
end
|
||
9 years ago
|
|
||
|
def control_link(action = :save)
|
||
|
raise 'Invalid link' unless [:save, :cancel].include?(action)
|
||
|
".inplace-edit--control--#{action}"
|
||
|
end
|
||
9 years ago
|
end
|