Skip to content

Commit

Permalink
[ML] Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
peteharverson committed Mar 22, 2022
1 parent 537f5da commit 1c92606
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default ({ getService }: FtrProviderContext) => {

expect(body[transformId].transformDeleted.success).to.eql(true);
expect(body[transformId].destIndexDeleted.success).to.eql(false);
expect(body[transformId].destIndexPatternDeleted.success).to.eql(false);
expect(body[transformId].destDataViewDeleted.success).to.eql(false);
await transform.api.waitForTransformNotToExist(transformId);
await transform.api.waitForIndicesToExist(destinationIndex);
});
Expand Down Expand Up @@ -244,7 +244,7 @@ export default ({ getService }: FtrProviderContext) => {
const reqBody: DeleteTransformsRequestSchema = {
transformsInfo: [{ id: transformId, state: TRANSFORM_STATE.STOPPED }],
deleteDestIndex: false,
deleteDestIndexPattern: true,
deleteDestDataView: true,
};
const { body, status } = await supertest
.post(`/api/transform/delete_transforms`)
Expand Down Expand Up @@ -284,7 +284,7 @@ export default ({ getService }: FtrProviderContext) => {
const reqBody: DeleteTransformsRequestSchema = {
transformsInfo: [{ id: transformId, state: TRANSFORM_STATE.STOPPED }],
deleteDestIndex: true,
deleteDestIndexPattern: true,
deleteDestDataView: true,
};
const { body, status } = await supertest
.post(`/api/transform/delete_transforms`)
Expand Down
4 changes: 2 additions & 2 deletions x-pack/test/functional/apps/transform/cloning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,8 @@ export default function ({ getService }: FtrProviderContext) {
await transform.wizard.setDestinationIndex(testData.destinationIndex);

await transform.testExecution.logTestStep('should display the create data view switch');
await transform.wizard.assertCreateIndexPatternSwitchExists();
await transform.wizard.assertCreateIndexPatternSwitchCheckState(true);
await transform.wizard.assertCreateDataViewSwitchExists();
await transform.wizard.assertCreateDataViewSwitchCheckState(true);

await transform.testExecution.logTestStep('should display the continuous mode switch');
await transform.wizard.assertContinuousModeSwitchExists();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,8 +589,8 @@ export default function ({ getService }: FtrProviderContext) {
await transform.wizard.setDestinationIndex(testData.destinationIndex);

await transform.testExecution.logTestStep('displays the create data view switch');
await transform.wizard.assertCreateIndexPatternSwitchExists();
await transform.wizard.assertCreateIndexPatternSwitchCheckState(true);
await transform.wizard.assertCreateDataViewSwitchExists();
await transform.wizard.assertCreateDataViewSwitchCheckState(true);

await transform.testExecution.logTestStep('displays the continuous mode switch');
await transform.wizard.assertContinuousModeSwitchExists();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ export default function ({ getService }: FtrProviderContext) {
await transform.wizard.setDestinationIndex(testData.destinationIndex);

await transform.testExecution.logTestStep('displays the create data view switch');
await transform.wizard.assertCreateIndexPatternSwitchExists();
await transform.wizard.assertCreateIndexPatternSwitchCheckState(true);
await transform.wizard.assertCreateDataViewSwitchExists();
await transform.wizard.assertCreateDataViewSwitchCheckState(true);

await transform.testExecution.logTestStep('displays the continuous mode switch');
await transform.wizard.assertContinuousModeSwitchExists();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ export default function ({ getService }: FtrProviderContext) {
await transform.wizard.setDestinationIndex(testData.destinationIndex);

await transform.testExecution.logTestStep('displays the create data view switch');
await transform.wizard.assertCreateIndexPatternSwitchExists();
await transform.wizard.assertCreateIndexPatternSwitchCheckState(true);
await transform.wizard.assertCreateDataViewSwitchExists();
await transform.wizard.assertCreateDataViewSwitchCheckState(true);

await transform.testExecution.logTestStep('displays the continuous mode switch');
await transform.wizard.assertContinuousModeSwitchExists();
Expand Down
8 changes: 4 additions & 4 deletions x-pack/test/functional/services/transform/wizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -670,13 +670,13 @@ export function TransformWizardProvider({ getService, getPageObjects }: FtrProvi
await this.assertDestinationIndexValue(destinationIndex);
},

async assertCreateIndexPatternSwitchExists() {
await testSubjects.existOrFail(`transformCreateIndexPatternSwitch`, { allowHidden: true });
async assertCreateDataViewSwitchExists() {
await testSubjects.existOrFail(`transformCreateDataViewSwitch`, { allowHidden: true });
},

async assertCreateIndexPatternSwitchCheckState(expectedCheckState: boolean) {
async assertCreateDataViewSwitchCheckState(expectedCheckState: boolean) {
const actualCheckState =
(await testSubjects.getAttribute('transformCreateIndexPatternSwitch', 'aria-checked')) ===
(await testSubjects.getAttribute('transformCreateDataViewSwitch', 'aria-checked')) ===
'true';
expect(actualCheckState).to.eql(
expectedCheckState,
Expand Down

0 comments on commit 1c92606

Please sign in to comment.