Skip to content

Instantly share code, notes, and snippets.

@goldbergyoni
Created December 23, 2018 19:08
Show Gist options
  • Select an option

  • Save goldbergyoni/4fd4d72070db102f4e8443cda949e321 to your computer and use it in GitHub Desktop.

Select an option

Save goldbergyoni/4fd4d72070db102f4e8443cda949e321 to your computer and use it in GitHub Desktop.
A test with many helpers and level of indirection
test("When getting orders report, get the existing orders", () => {
const queryObject = QueryHelpers.getQueryObject(config.DBInstanceURL);
const reportConfiguration = ReportHelpers.getReportConfig();//What report config did we get? have to leave the test and read
userHelpers.prepareQueryPermissions(reportConfiguration);//what this one is doing? have to leave the test and read
const result = queryObject.query(reportConfiguration);
assertThatReportIsValid();//I wonder what this one does, have to leave the test and read
expect(result).to.be.an('array').that.does.include({id:1, productd:2, orderStatus:"approved"});
//how do we know this order exist? have to leave the test and check
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment