Skip to content

Commit 765f8a6

Browse files
committed
Make the backtrace configuration UI match other booleans
This has the side benefit of not exceeding the width of the config widget.
1 parent 01bb4ab commit 765f8a6

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

tests/spec/features/backtrace_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
context "backtraces are enabled" do
1414
before do
15-
in_advanced_options_menu { choose 'enabled' }
15+
in_advanced_options_menu { within(:config_option, 'Backtrace') { choose 'On' } }
1616
within(:header) { click_on("Run") }
1717
end
1818

tests/spec/spec_helper.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@
8888
css { '[data-test-id = "notification"]' }
8989
end
9090

91+
Capybara.add_selector(:config_option) do
92+
xpath do |label|
93+
".//div[span[contains(., '#{label}')]]"
94+
end
95+
end
96+
9197
RSpec.configure do |config|
9298
config.after(:example, :js) do
9399
page.execute_script <<~JS

ui/frontend/AdvancedOptionsMenu.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ const AdvancedOptionsMenu: React.FC = () => {
3838
<EitherConfig
3939
id="backtrace"
4040
name="Backtrace"
41-
a={Backtrace.Disabled}
42-
b={Backtrace.Enabled}
41+
a={Backtrace.Enabled}
42+
b={Backtrace.Disabled}
43+
aLabel="On"
44+
bLabel="Off"
4345
value={backtrace}
4446
isDefault={isBacktraceDefault}
4547
onChange={changeBacktrace}

0 commit comments

Comments
 (0)