Skip to content

Commit 880e324

Browse files
CianMmartijnrusschen
authored andcommitted
Fix typo in month dropdown selected option class (Hacker0x01#1902)
1 parent 61d30bb commit 880e324

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/month_dropdown_options.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default class MonthDropdownOptions extends React.Component {
1414
<div
1515
className={
1616
this.props.month === i
17-
? "react-datepicker__month-option --selected_month"
17+
? "react-datepicker__month-option react-datepicker__month-option--selected_month"
1818
: "react-datepicker__month-option"
1919
}
2020
key={month}

test/month_dropdown_test.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe("MonthDropdown", () => {
4141
monthDropdown = getMonthDropdown();
4242
});
4343

44-
it("shows the selected yonth in the initial view", () => {
44+
it("shows the selected month in the initial view", () => {
4545
expect(monthDropdown.text()).to.contain("December");
4646
});
4747

@@ -53,6 +53,16 @@ describe("MonthDropdown", () => {
5353
expect(optionsView).to.exist;
5454
});
5555

56+
it("applies the 'selected' modifier class to the selected month", () => {
57+
monthDropdown
58+
.find(".react-datepicker__month-read-view")
59+
.simulate("click");
60+
var selectedMonth = monthDropdown.find(
61+
".react-datepicker__month-option--selected_month"
62+
);
63+
expect(selectedMonth.text()).to.contain("December");
64+
});
65+
5666
it("closes the dropdown when a month is clicked", () => {
5767
monthDropdown
5868
.find(".react-datepicker__month-read-view")

0 commit comments

Comments
 (0)