From 9d4d9c76a7725e61c38f9a3ecbd9acdde0add717 Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 22 Apr 2016 09:52:15 -0500 Subject: [PATCH] Copy test changes from team-experiments branch Based on discussion at https://github.com/gratipay/grtp.co/pull/112#issuecomment-212478637. Breaking up that PR into more manageable chunks. --- test/test_custom-widget-legacy.js | 4 ++-- test/test_custom-widget.js | 4 ++-- test/test_default-widget-anonymous.js | 19 +++---------------- test/test_default-widget-legacy.js | 4 ++-- test/test_default-widget.js | 4 ++-- test/test_expose-api-to-iframe.js | 2 +- test/test_giving-widget-anonymous.js | 4 ++-- test/test_giving-widget-legacy.js | 4 ++-- test/test_giving-widget.js | 4 ++-- 9 files changed, 18 insertions(+), 31 deletions(-) diff --git a/test/test_custom-widget-legacy.js b/test/test_custom-widget-legacy.js index aea9773..3c2da21 100644 --- a/test/test_custom-widget-legacy.js +++ b/test/test_custom-widget-legacy.js @@ -1,6 +1,6 @@ module.exports = { - 'readystatus should be ready': function(test) { + 'custom-widget-legacy: readystatus should be ready': function(test) { test.open('http://localhost:9537/test/custom-widget-legacy.html') .waitFor(function() { return !!document.querySelector('[data-gratipay-readystatus="ready"]'); @@ -9,7 +9,7 @@ module.exports = { .done(); }, - 'it should fill the standard values': function(test) { + 'custom-widget-legacy: it should fill the standard values': function(test) { test.open('http://localhost:9537/test/custom-widget-legacy.html') .waitFor(function() { return !!document.querySelector('[data-gratipay-readystatus="ready"]'); diff --git a/test/test_custom-widget.js b/test/test_custom-widget.js index e065fc4..f7c206c 100644 --- a/test/test_custom-widget.js +++ b/test/test_custom-widget.js @@ -1,6 +1,6 @@ module.exports = { - 'readystatus should be ready': function(test) { + 'custom-widget: readystatus should be ready': function(test) { test.open('http://localhost:9537/test/custom-widget.html') .waitFor(function() { return !!document.querySelector('[data-gratipay-readystatus="ready"]'); @@ -9,7 +9,7 @@ module.exports = { .done(); }, - 'it should fill the standard values': function(test) { + 'custom-widget: it should fill the standard values': function(test) { test.open('http://localhost:9537/test/custom-widget.html') .waitFor(function() { return !!document.querySelector('[data-gratipay-readystatus="ready"]'); diff --git a/test/test_default-widget-anonymous.js b/test/test_default-widget-anonymous.js index 0f9cf05..1a1cc7d 100644 --- a/test/test_default-widget-anonymous.js +++ b/test/test_default-widget-anonymous.js @@ -1,25 +1,12 @@ module.exports = { - 'readystatus should be ready': function(test) { + 'default-widget-anonymous: readystatus should be ready': function(test) { test.open('http://localhost:9537/test/default-widget-anonymous.html') .waitFor(function() { return !!document.querySelector('[data-gratipay-readystatus="ready"]'); }, [], 2000) .assert.attr('[data-gratipay-username]', 'data-gratipay-readystatus').is('ready', 'readystatus should be ready') .done(); - }, - - 'it should show anonymous receiving': function(test) { - test.open('http://localhost:9537/test/default-widget-anonymous.html') - .waitFor(function() { - return !!document.querySelector('[data-gratipay-readystatus="ready"]'); - }, [], 2000) - .assert.exists('iframe') - .toFrame('iframe') - .assert.exists('.gratipay-receiving') - .assert.text('.gratipay-receiving').is('anonymously', 'receiving should not be empty') - .toParent() - .done(); - }, - + } + }; diff --git a/test/test_default-widget-legacy.js b/test/test_default-widget-legacy.js index 2efd5b2..e4452dd 100644 --- a/test/test_default-widget-legacy.js +++ b/test/test_default-widget-legacy.js @@ -1,6 +1,6 @@ module.exports = { - 'readystatus should be ready': function(test) { + 'default-widget-legacy: readystatus should be ready': function(test) { test.open('http://localhost:9537/test/default-widget-legacy.html') .waitFor(function() { return !!document.querySelector('[data-gratipay-readystatus="ready"]'); @@ -9,7 +9,7 @@ module.exports = { .done(); }, - 'it should fill the standard values': function(test) { + 'default-widget-legacy: it should fill the standard values': function(test) { test.open('http://localhost:9537/test/default-widget-legacy.html') .waitFor(function() { return !!document.querySelector('[data-gratipay-readystatus="ready"]'); diff --git a/test/test_default-widget.js b/test/test_default-widget.js index 17dc215..8476243 100644 --- a/test/test_default-widget.js +++ b/test/test_default-widget.js @@ -1,6 +1,6 @@ module.exports = { - 'readystatus should be ready': function(test) { + 'default-widget: readystatus should be ready': function(test) { test.open('http://localhost:9537/test/default-widget.html') .waitFor(function() { return !!document.querySelector('[data-gratipay-readystatus="ready"]'); @@ -9,7 +9,7 @@ module.exports = { .done(); }, - 'it should fill the standard values': function(test) { + 'default-widget: it should fill the standard values': function(test) { test.open('http://localhost:9537/test/default-widget.html') .waitFor(function() { return !!document.querySelector('[data-gratipay-readystatus="ready"]'); diff --git a/test/test_expose-api-to-iframe.js b/test/test_expose-api-to-iframe.js index f086ca4..8afdee9 100644 --- a/test/test_expose-api-to-iframe.js +++ b/test/test_expose-api-to-iframe.js @@ -1,6 +1,6 @@ module.exports = { - 'widget should have Gratipay defined': function(test) { + 'expose-api-to-iframe: widget should have Gratipay defined': function(test) { test.open('http://localhost:9537/test/expose-api-to-iframe.html') .waitFor(function() { return !!document.querySelector('[data-gratipay-readystatus="ready"]'); diff --git a/test/test_giving-widget-anonymous.js b/test/test_giving-widget-anonymous.js index 910d809..b4649e4 100644 --- a/test/test_giving-widget-anonymous.js +++ b/test/test_giving-widget-anonymous.js @@ -1,6 +1,6 @@ module.exports = { - 'readystatus should be ready': function(test) { + 'giving-widget-anonymous: readystatus should be ready': function(test) { test.open('http://localhost:9537/test/giving-widget-anonymous.html') .waitFor(function() { return !!document.querySelector('[data-gratipay-readystatus="ready"]'); @@ -9,7 +9,7 @@ module.exports = { .done(); }, - 'it should show anonymous giving': function(test) { + 'giving-widget-anonymous: it should show anonymous giving': function(test) { test.open('http://localhost:9537/test/giving-widget-anonymous.html') .waitFor(function() { return !!document.querySelector('[data-gratipay-readystatus="ready"]'); diff --git a/test/test_giving-widget-legacy.js b/test/test_giving-widget-legacy.js index dd243f7..97dd371 100644 --- a/test/test_giving-widget-legacy.js +++ b/test/test_giving-widget-legacy.js @@ -1,6 +1,6 @@ module.exports = { - 'readystatus should be ready': function(test) { + 'giving-widget-legacy: readystatus should be ready': function(test) { test.open('http://localhost:9537/test/giving-widget-legacy.html') .waitFor(function() { return !!document.querySelector('[data-gratipay-readystatus="ready"]'); @@ -9,7 +9,7 @@ module.exports = { .done(); }, - 'it should fill the standard values': function(test) { + 'giving-widget-legacy: it should fill the standard values': function(test) { test.open('http://localhost:9537/test/giving-widget-legacy.html') .waitFor(function() { return !!document.querySelector('[data-gratipay-readystatus="ready"]'); diff --git a/test/test_giving-widget.js b/test/test_giving-widget.js index f428242..847c681 100644 --- a/test/test_giving-widget.js +++ b/test/test_giving-widget.js @@ -1,6 +1,6 @@ module.exports = { - 'readystatus should be ready': function(test) { + 'giving-widget: readystatus should be ready': function(test) { test.open('http://localhost:9537/test/giving-widget.html') .waitFor(function() { return !!document.querySelector('[data-gratipay-readystatus="ready"]'); @@ -9,7 +9,7 @@ module.exports = { .done(); }, - 'it should fill the standard values': function(test) { + 'giving-widget: it should fill the standard values': function(test) { test.open('http://localhost:9537/test/giving-widget.html') .waitFor(function() { return !!document.querySelector('[data-gratipay-readystatus="ready"]');