Skip to content

Commit 45c3831

Browse files
committed
Change edition selection to a dropdown
Soon it will have 3 values
1 parent 18d31d4 commit 45c3831

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

tests/spec/features/editions_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
end
1212

1313
scenario "using the 2015 edition" do
14-
in_advanced_options_menu { choose '2015' }
14+
in_advanced_options_menu { select '2015' }
1515
click_on("Run")
1616

1717
within(:output, :stderr) do
@@ -21,7 +21,7 @@
2121
end
2222

2323
scenario "using the 2018 edition" do
24-
in_advanced_options_menu { choose '2018' }
24+
in_advanced_options_menu { select '2018' }
2525
click_on("Run")
2626

2727
within(:output, :stderr) do

tests/spec/features/sharing_with_others_spec.rb

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

1515
in_channel_menu { click_on("Nightly") }
1616
in_mode_menu { click_on("Release") }
17-
in_advanced_options_menu { choose("2018") }
17+
in_advanced_options_menu { select("2018") }
1818

1919
within(:header) { click_on 'Share' }
2020

tests/spec/features/url_parameters_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
RSpec::Matchers.define :have_edition do |expected|
2727
match do |actual|
2828
in_advanced_options_menu do
29-
expect(page).to have_checked_field(expected, visible: false)
29+
expect(page).to have_select(selected: expected)
3030
end
3131
end
3232
end

ui/frontend/AdvancedOptionsMenu.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useCallback } from 'react';
22
import { useSelector, useDispatch } from 'react-redux';
33

44
import * as actions from './actions';
5-
import { Either as EitherConfig } from './ConfigElement';
5+
import { Either as EitherConfig, Select as SelectConfig } from './ConfigElement';
66
import MenuGroup from './MenuGroup';
77
import { State } from './reducers';
88
import * as selectors from './selectors';
@@ -21,14 +21,15 @@ const AdvancedOptionsMenu: React.SFC = () => {
2121

2222
return (
2323
<MenuGroup title="Advanced options">
24-
<EitherConfig
25-
id="edition"
24+
<SelectConfig
2625
name="Edition"
27-
a={Edition.Rust2015}
28-
b={Edition.Rust2018}
2926
value={edition}
3027
isNotDefault={isEditionSet}
31-
onChange={changeEdition} />
28+
onChange={changeEdition}
29+
>
30+
<option value={Edition.Rust2015}>2015</option>
31+
<option value={Edition.Rust2018}>2018</option>
32+
</SelectConfig>
3233

3334
<EitherConfig
3435
id="backtrace"

0 commit comments

Comments
 (0)