Skip to content

Commit

Permalink
Adapt expect data for cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
kertal committed Jul 6, 2020
1 parent 2c27bad commit 5cbaf6a
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 5cbaf6a

Please sign in to comment.