Skip to content

Instantly share code, notes, and snippets.

@adamrneary
Last active March 22, 2016 15:35
Show Gist options
  • Save adamrneary/cfafd47d226d51ebda02 to your computer and use it in GitHub Desktop.
Save adamrneary/cfafd47d226d51ebda02 to your computer and use it in GitHub Desktop.
const assign = (data) => Object.assign(testData, data);
module.exports = {
before(client, done) {
helpers.init(client)
.then(() => helpers.createTeam()
.then(assign))
.then(() => helpers.createJob(testData.team)
.then(job => assign({ job })))
.then(() => {
return Promise
.all([
helpers.createTemplate(testData.team, { publish: true }),
helpers.createTemplate(testData.team, { publish: true }),
helpers.createTemplate(testData.team, { publish: true }),
helpers.createTemplate(testData.team, { publish: true }),
helpers.createTemplate(testData.team, { publish: true })
])
.then(templates => assign({ templates }));
})
.then(() => helpers.createTemplateSet(testData.team, { templates: testData.templates.slice(0, 2) })
.then(templateSet => assign({ templateSet })))
.then(() => {
templateList = client.page.templateList();
templateSetEditor = client.page.templateSetEditor();
})
.then(() => helpers.ui.adminLogin(testData.credentials, testData.team))
.then(done)
.catch(console.error);
},
after(client) {
client.end();
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment