I am validating a drop down box that contains years.
Below is my code to validate the drop-down box. However protractor still returns an error message for that line of code. I am not sure why its returning an error message.
var EachYear = element.all(by.id("Years"));
expect(EachYear.getText()).toBe(['Year\n2017\n2018\n2019\n2020\n2021\n2022\n2023']);
Error message
Expected [ 'Year 2017 2018 2019 2020 2021 2022 2023' ] to be [ 'Year 2017 2018 2019 2020 2021 2022 2023' ].✗