Skip to content

Commit

Permalink
Adapt expected response of advanced settings feature control for clou…
Browse files Browse the repository at this point in the history
…d tests (#70793)
  • Loading branch information
kertal authored Jul 7, 2020
1 parent f62f3e3 commit 4257afa
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,16 @@ export default function featureControlsTests({ getService }: FtrProviderContext)
};

const expectResponse = (result: any) => {
expect(result.error).to.be(undefined);
expect(result.response).not.to.be(undefined);
expect(result.response).to.have.property('statusCode', 200);
if (result.response && result.response.statusCode === 400) {
// expect a change of telemetry settings to fail in cloud environment
expect(result.response.body.message).to.be(
'{"error":"Not allowed to change Opt-in Status."}'
);
} else {
expect(result.error).to.be(undefined);
expect(result.response).not.to.be(undefined);
expect(result.response).to.have.property('statusCode', 200);
}
};

async function saveAdvancedSetting(username: string, password: string, spaceId?: string) {
Expand Down

0 comments on commit 4257afa

Please sign in to comment.