mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-21 07:46:06 +08:00
fix(tests): fix composer integration tests
This commit is contained in:
parent
7275336665
commit
0e583de21b
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue