Skip to content

Commit

Permalink
[IM] Updated the branch after merging main
Browse files Browse the repository at this point in the history
  • Loading branch information
yuliacech committed Mar 28, 2022
1 parent f1748ff commit df62d6d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,23 @@ import {

describe('A11y Indices tab', () => {
let testBed: IndicesTestBed;
let server: ReturnType<typeof setupEnvironment>['server'];
let httpSetup: ReturnType<typeof setupEnvironment>['httpSetup'];
let httpRequestsMockHelpers: ReturnType<typeof setupEnvironment>['httpRequestsMockHelpers'];

beforeEach(async () => {
({ server, httpRequestsMockHelpers } = setupEnvironment());
httpRequestsMockHelpers.setLoadIndicesResponse([]);
testBed = await setup();
});

afterAll(() => {
server.restore();
beforeEach(() => {
const mockEnvironment = setupEnvironment();
httpRequestsMockHelpers = mockEnvironment.httpRequestsMockHelpers;
httpSetup = mockEnvironment.httpSetup;
});

it('when there are no indices', async () => {
httpRequestsMockHelpers.setLoadIndicesResponse([]);
await act(async () => {
testBed = await setup();
testBed = await setup(httpSetup);
});
const { component } = testBed;
component.update();
// this is expected to fail and needs to be updated when eui#5674 is available in Kibana
// this is expected to fail and needs to be updated when EUI 52.0.0 is available in Kibana
// await expectToBeAccessible(component);
// until then check that only 1 expected violation is found
const violations = await getA11yViolations(component);
Expand All @@ -57,11 +53,11 @@ describe('A11y Indices tab', () => {
createDataStreamBackingIndex('data-stream-test-index', 'test-data-stream'),
]);
await act(async () => {
testBed = await setup();
testBed = await setup(httpSetup);
});
const { component } = testBed;
component.update();
// this is expected to fail and needs to be updated when https://github.com/elastic/eui/pull/5709 is available in Kibana
// this is expected to fail and needs to be updated when EUI 52.0.0 is available in Kibana
// await expectToBeAccessible(component);
// until then check that only 1 expected violation is found
const violations = await getA11yViolations(component);
Expand All @@ -79,7 +75,7 @@ describe('A11y Indices tab', () => {
httpRequestsMockHelpers.setLoadIndexMappingResponse(indexMappings);
httpRequestsMockHelpers.setLoadIndexStatsResponse(indexStats);
await act(async () => {
testBed = await setup();
testBed = await setup(httpSetup);
});
const { component, find } = testBed;
component.update();
Expand All @@ -90,7 +86,7 @@ describe('A11y Indices tab', () => {
it('summary tab', async () => {
const { component, find } = testBed;
expect(find('detailPanelTabSelected').text()).toEqual('Summary');
// this is expected to fail and needs to be updated when https://github.com/elastic/eui/pull/5709 is available in Kibana
// this is expected to fail and needs to be updated when EUI 52.0.0 is available in Kibana
// await expectToBeAccessible(component);
// until then check that only 1 expected violation is found
const violations = await getA11yViolations(component);
Expand All @@ -103,7 +99,7 @@ describe('A11y Indices tab', () => {
const { component, find, actions } = testBed;
await actions.selectIndexDetailsTab(tab as 'settings');
expect(find('detailPanelTabSelected').text().toLowerCase()).toEqual(tab);
// this is expected to fail and needs to be updated when https://github.com/elastic/eui/pull/5709 is available in Kibana
// this is expected to fail and needs to be updated when EUI 52.0.0 is available in Kibana
// await expectToBeAccessible(component);
// until then check that only 1 expected violation is found
const violations = await getA11yViolations(component);
Expand All @@ -117,7 +113,7 @@ describe('A11y Indices tab', () => {
const { component, find, actions } = testBed;
await actions.selectIndexDetailsTab('edit_settings');
expect(find('detailPanelTabSelected').text()).toEqual('Edit settings');
// this is expected to fail and needs to be updated when https://github.com/elastic/eui/pull/5709 is available in Kibana
// this is expected to fail and needs to be updated when EUI 52.0.0 is available in Kibana
// await expectToBeAccessible(component);
// until then check that only 1 expected violation is found
const violations = await getA11yViolations(component);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,14 @@ const registerHttpRequestMockHelpers = (
const setCreateTemplateResponse = (response?: HttpResponse, error?: ResponseError) =>
mockResponse('POST', `${API_BASE_PATH}/index_templates`, response, error);

const setUpdateTemplateResponse = (
templateId: string,
response?: HttpResponse,
error?: ResponseError
) => mockResponse('PUT', `${API_BASE_PATH}/index_templates/${templateId}`, response, error);
const setLoadIndexSettingsResponse = (response?: HttpResponse, error?: ResponseError) =>
mockResponse('GET', `${API_BASE_PATH}/settings/:name`, response, error);

const setLoadIndexMappingResponse = (response?: HttpResponse, error?: ResponseError) =>
mockResponse('GET', `${API_BASE_PATH}/mapping/:name`, response, error);

const setLoadIndexStatsResponse = (response?: HttpResponse, error?: ResponseError) =>
mockResponse('GET', `${API_BASE_PATH}/stats/:name`, response, error);

const setUpdateIndexSettingsResponse = (
indexName: string,
Expand Down

0 comments on commit df62d6d

Please sign in to comment.