Skip to content

Commit

Permalink
Fix misc tests/type updates caused by EuiSuperDatePicker i18n release
Browse files Browse the repository at this point in the history
- Fix mock typeof: this changed because the exported EuiSuperDatePicker is no longer a class, but a functional component wrapper around a class

- CI test: update now-capitalized datepicker select copy

- Jest tests: update snapshots, find()s (`Memo()` selector change is due to the exported EuiSuperDatePicker change)
  • Loading branch information
cee-chen committed Mar 30, 2022
1 parent 4af747a commit 44ceab2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function wrapQueryBarTopRowInContext(testProps: any) {

describe('QueryBarTopRowTopRow', () => {
const QUERY_INPUT_SELECTOR = 'QueryStringInputUI';
const TIMEPICKER_SELECTOR = 'EuiSuperDatePicker';
const TIMEPICKER_SELECTOR = 'Memo(EuiSuperDatePicker)';
const TIMEPICKER_DURATION = '[data-shared-timefilter-duration]';

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ jest.mock('../../../contexts/kibana', () => ({
},
}));

const MockedEuiSuperDatePicker = EuiSuperDatePicker as jest.MockedClass<typeof EuiSuperDatePicker>;
const MockedEuiSuperDatePicker = EuiSuperDatePicker as jest.MockedFunction<
typeof EuiSuperDatePicker
>;

describe('Navigation Menu: <DatePickerWrapper />', () => {
beforeEach(() => {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function ({ getPageObjects, getService }) {
it('should update global Kibana refresh config to value stored with map', async () => {
const kibanaRefreshConfig = await PageObjects.timePicker.getRefreshConfig();
expect(kibanaRefreshConfig.interval).to.equal('1');
expect(kibanaRefreshConfig.units).to.equal('seconds');
expect(kibanaRefreshConfig.units).to.equal('Seconds');
expect(kibanaRefreshConfig.isPaused).to.equal(true);
});

Expand Down

0 comments on commit 44ceab2

Please sign in to comment.