Merge pull request #669 from liyasthomas/feature/api

 Updating tests
This commit is contained in:
Liyas Thomas
2020-03-12 23:35:06 +05:30
committed by GitHub

View File

@@ -1,3 +1,16 @@
// describe("Proxy disabled - local request", () => {
// it("Change default URL with query and make a request to local Cat API", () => {
// cy.seedAndVisit("catapi", "/?url=https://api.thecatapi.com&path=")
// .get("#url")
// .then(el => expect(el.val() === "https://api.thecatapi.com").to.equal(true))
// .get("#response-details-wrapper", { timeout: 24000 })
// .should("be.visible")
// .should($wrapper => {
// expect($wrapper).to.contain("FAKE Cat API")
// })
// })
// })
describe("Proxy enabled - external request", () => {
it("Enable proxy and make a GET request to Postwoman API", () => {
cy.enableProxy("/?url=https://postwoman.io&path=/.netlify/functions/api")
@@ -10,16 +23,3 @@ describe("Proxy enabled - external request", () => {
})
})
})
describe("Proxy disabled - local request", () => {
it("Change default URL with query and make a request to local Cat API", () => {
cy.seedAndVisit("catapi", "/?url=https://api.thecatapi.com&path=")
.get("#url")
.then(el => expect(el.val() === "https://api.thecatapi.com").to.equal(true))
.get("#response-details-wrapper")
.should("be.visible")
.should($wrapper => {
expect($wrapper).to.contain("FAKE Cat API")
})
})
})