Skip to content
This repository has been archived by the owner. It is now read-only.

fx-desktop glue & start to set up front end unit tests. #191

Merged
merged 1 commit into from Jan 13, 2014
Merged

fx-desktop glue & start to set up front end unit tests. #191

merged 1 commit into from Jan 13, 2014

Conversation

@shane-tomlinson
Copy link
Member

@shane-tomlinson shane-tomlinson commented Jan 7, 2014

  • Add mocha & chai to the bower config
  • Add a test shell for the confirm screen.

I realize standalone mocha tests is not how the intern works, but I was unsure of how to get the intern working with our system and TDD. There was too much bashing my head, so I went with what I know. We can convert these.

@shane-tomlinson
Copy link
Member Author

@shane-tomlinson shane-tomlinson commented Jan 8, 2014

Link to #189

// A few globals
function (Polyfills, Backbone, Router, Translator, Session, FxDesktopChannel) {
// Firefox for desktop native=>FxA glue code.
var desktopChannel = new FxDesktopChannel();

This comment has been minimized.

@shane-tomlinson

shane-tomlinson Jan 9, 2014
Author Member

We will also need a channel for normal web content, for a later date.

@shane-tomlinson
Copy link
Member Author

@shane-tomlinson shane-tomlinson commented Jan 9, 2014

@zaach - and this one over here too. :D

@@ -12,7 +12,9 @@
"jquery.transit": "~0.9.9",
"requirejs-mustache": "*",
"mustache": "~0.7.3",
"requirejs-text": "~2.0.10"
"requirejs-text": "~2.0.10",
"mocha": "~1.16.2",

This comment has been minimized.

@zaach

zaach Jan 9, 2014
Contributor

I wouldn't mind keeping mocha. But can we set it up to run on sauce along with the functional tests like theintern allows?

This comment has been minimized.

@shane-tomlinson

shane-tomlinson Jan 10, 2014
Author Member

@zaach - I am attempting to port the tests over to the intern, on the surface it seems easy, but I am fighting with the AMD loader.

This comment has been minimized.

@shane-tomlinson

shane-tomlinson Jan 10, 2014
Author Member

@zaach - so I took a different approach here. I struggled with getting the intern running with RequireJS and the built in AMD loader does not support the shim configuration item to be able to shim in things like backbone, jquery, etc. So, I decided I'd create a functional test that opens the mocha tests, and then checks for errors. https://github.com/mozilla/fxa-content-server/pull/191/files#diff-7b0417d0bfcde3acae14d9aa1bfa803eR20

Ugh. Is there a better way than this?

@shane-tomlinson
Copy link
Member Author

@shane-tomlinson shane-tomlinson commented Jan 10, 2014

@zaach - did an update to run the mocha tests as a functional test. I'm not terribly happy with it, do you know how we can get our client side code loaded correctly into an intern tdd test?

* Add mocha & chai to the bower config.
* Add a functional test shell for the confirm screen.
* Go to the correct page on startup if the browser supports Fx events.
* Mocha tests now run as part of the intern functional tests.
@zaach
Copy link
Contributor

@zaach zaach commented Jan 13, 2014

I was getting a couple of errors from the chrome side:

A promise chain failed to handle a rejection.

Date: Mon Jan 13 2014 13:29:04 GMT-0800 (PST)
Full Message: The object could not be cloned.
Full Stack: JS frame :: chrome://browser/content/aboutaccounts/aboutaccounts.js :: wrapper.injectData :: line 128
JS frame :: chrome://browser/content/aboutaccounts/aboutaccounts.js :: wrapper.onLogin/< :: line 67
JS frame :: resource://gre/modules/Promise.jsm :: Handler.prototype.process :: line 770
JS frame :: resource://gre/modules/Promise.jsm :: this.PromiseWalker.walkerLoop :: line 531
native frame :: <unknown filename> :: <TOP_LEVEL> :: line 0 aboutaccounts.js:128
A promise chain failed to handle a rejection.

Date: Mon Jan 13 2014 13:29:05 GMT-0800 (PST)
Full Message: Error: Verification aborted; Another user signing in
Full Stack: abortExistingFlow@resource://gre/modules/FxAccounts.jsm:99
setSignedInUser@resource://gre/modules/FxAccounts.jsm:488
wrapper.onLogin@chrome://browser/content/aboutaccounts/aboutaccounts.js:56
wrapper.handleRemoteCommand@chrome://browser/content/aboutaccounts/aboutaccounts.js:102
wrapper.handleEvent@chrome://browser/content/aboutaccounts/aboutaccounts.js:42
.send@https://accounts-latest.dev.lcip.org/scripts/main.js:6
f/b.timeout<@https://accounts-latest.dev.lcip.org/scripts/main.js:6

I'm attempting to verify that I was still able to log in (awsbox deploys are so slow).

@zaach
Copy link
Contributor

@zaach zaach commented Jan 13, 2014

A second time around and those errors aren't showing up, but I can't get through the whole flow because our email verification is broken #222.

@zaach
Copy link
Contributor

@zaach zaach commented Jan 13, 2014

Good news! I was able to successfully log in, and the browser remembers my logged in state. r+

zaach added a commit that referenced this pull request Jan 13, 2014
fx-desktop glue & start to set up front end unit tests.
@zaach zaach merged commit feb5a20 into mozilla:develop Jan 13, 2014
1 check passed
1 check passed
@rik
default The Travis CI build passed
Details
@shane-tomlinson shane-tomlinson deleted the shane-tomlinson:issue-189-fx-native-glue branch Jan 14, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants