From c9e6563a4456abb43a59d488ef5f98a9ad0135b7 Mon Sep 17 00:00:00 2001 From: Lokesh Dhakar Date: Sat, 24 Aug 2019 18:59:26 -0700 Subject: [PATCH] test: Add test for CORS --- cypress/integration/cors_spec.js | 9 ++++++++ cypress/test-pages/cors.html | 38 ++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 cypress/integration/cors_spec.js create mode 100644 cypress/test-pages/cors.html diff --git a/cypress/integration/cors_spec.js b/cypress/integration/cors_spec.js new file mode 100644 index 0000000..adbdd2b --- /dev/null +++ b/cypress/integration/cors_spec.js @@ -0,0 +1,9 @@ +describe('cross domain images with liberal CORS policy', function() { + it('load', function() { + cy.visit('http://localhost:8080/cypress/test-pages/cors.html'); + cy.get('#result').should(($el) => { + const count = $el.text().split(',').length + expect(count).to.equal(3); + }); + }) +}); diff --git a/cypress/test-pages/cors.html b/cypress/test-pages/cors.html new file mode 100644 index 0000000..eb4c7ef --- /dev/null +++ b/cypress/test-pages/cors.html @@ -0,0 +1,38 @@ + + + + + + Color Thief + + + + + + +
+ + + + + +