fix(tests): fix composer integration tests

This commit is contained in:
Evan Morikawa 2015-12-14 12:05:34 -08:00
parent 7275336665
commit 0e583de21b
3 changed files with 27 additions and 4 deletions

View file

@ -1,7 +1,7 @@
import N1Launcher from './helpers/n1-launcher'
import ContenteditableTestHarness from './helpers/contenteditable-test-harness.es6'
describe('Contenteditable Integration Spec', function() {
fdescribe('Contenteditable Integration Spec', function() {
beforeAll((done)=>{
this.app = new N1Launcher(["--dev"]);
this.app.popoutComposerWindowReady().finally(done);

View file

@ -36,6 +36,7 @@ export default class N1Launcher extends Application {
popoutComposerWindowReady() {
return this.windowReady(N1Launcher.mainWindowLoadedMatcher).then(() => {
<<<<<<< Updated upstream
return this.client.execute((FAKE_DATA_PATH)=>{
$n.AccountStore._importFakeData(FAKE_DATA_PATH)
$n.Actions.composeNewBlankDraft();
@ -45,6 +46,25 @@ export default class N1Launcher extends Application {
return this.client.window(windowId)
})
})
=======
return this.client
.timeoutsAsyncScript(5000)
.executeAsync((fakeDataPath, done) => {
return $n.AccountStore._importFakeData(fakeDataPath).then(function(){
$n.Actions.composeNewBlankDraft();
done();
});
}, FAKE_DATA_PATH);
}).then(()=>{
return N1Launcher.waitUntilMatchingWindowLoaded(this.client, N1Launcher.composerWindowMatcher).then((windowId)=>{
return new Promise((resolve,reject) => {
setTimeout(() => {
resolve(this.client.window(windowId));
}, 500);
});
});
});
>>>>>>> Stashed changes
}
windowReady(matcher) {

View file

@ -180,6 +180,8 @@ class AccountStore
account.serverId = account.clientId
account.emailAddress = "nora@nylas.com"
account.organizationUnit = 'label'
account.label = "Nora's Email"
account.aliases = []
account.name = "Nora"
account.provider = "gmail"
@_accounts.push(account)
@ -226,8 +228,9 @@ class AccountStore
threads.push(thread)
downloadsDir = path.join(dir, 'downloads')
for filename in fs.readdirSync(downloadsDir)
fs.copySync(path.join(downloadsDir, filename), path.join(NylasEnv.getConfigDirPath(), 'downloads', filename))
if fs.existsSync(downloadsDir)
for filename in fs.readdirSync(downloadsDir)
fs.copySync(path.join(downloadsDir, filename), path.join(NylasEnv.getConfigDirPath(), 'downloads', filename))
Promise.all([
DatabaseStore.persistModel(account),
@ -235,6 +238,6 @@ class AccountStore
DatabaseStore.persistModels(messages),
DatabaseStore.persistModels(threads)
]).then =>
Actions.selectAccountId account.id
Actions.selectAccount account.id
module.exports = new AccountStore()