open-consul/ui-v2/tests/helpers
John Cowen 04308c8e8d Move testing doubles to use data embedded in the HTML vs HTTP/fetch
Previously `api-double` usage in ember would require a bunch of `fetch`
requests to pull in the 'api double', this had a number of disadvantages.

1. The doubles needed to be available via HTTP, which meant a short term
solution of rsyncing the double files over to `public` in order to be served
over HTTP. An alternative to that would have been figuring out how to serve
something straight from `node_modules`, which would have been preferable.

2. ember/testem would not serve dot files (so anything starting with a
., like `.config`. To solve this via ember/testem would have involved
digging in to understand how to enable the serving of dot files.

3. ember/testem automatically rewrote urls for non-existant files to
folders, i.e. adding a slash for you, so `/v1/connect/intentions` would
be rewritten to `/v1/connect/intentions/`. This is undesirable, and
solving this via ember/testem would have involved digging deep to
disable that.

Serving the files via HTTP has now changed. The double files are now
embedded into the HTML has 'embedded templates' that can be found by
using the url of the file and a simple `querySelector`. This of course
only happens during testing and means I can fully control the 'serving'
of the doubles now, so I can say goodbye to the need to move files
around, worry about the need to serve dotfiles and the undesirable
trailing slashes rewriting. Winner!

Find the files and embedding them is done using a straightforward
recursive-readdir-sync (the `content-for` functionality is a synchronous
api) as oppose to getting stuck into `broccoli`.
2018-07-02 19:02:16 +01:00
..
api.js Move testing doubles to use data embedded in the HTML vs HTTP/fetch 2018-07-02 19:02:16 +01:00
destroy-app.js UI V2 (#4086) 2018-05-10 19:52:53 +01:00
flash-message.js UI V2 (#4086) 2018-05-10 19:52:53 +01:00
module-for-acceptance.js UI V2 (#4086) 2018-05-10 19:52:53 +01:00
set-cookies.js Merge remote-tracking branch 'connect/f-connect' 2018-06-25 19:42:51 +00:00
start-app.js UI V2 (#4086) 2018-05-10 19:52:53 +01:00
stub-super.js UI V2 (#4086) 2018-05-10 19:52:53 +01:00
type-to-url.js Fix up following rebase, use array of strings rather than its own func 2018-06-21 11:06:45 +01:00
yadda-annotations.js Ensure a blank token is sent if the localStorage kv doesn't exist 2018-06-20 10:32:35 +01:00
yadda.js WIP: Feature/acceptance tests 2018-06-12 11:24:35 +01:00