Commit 92c93b45 authored by Ana Ellis's avatar Ana Ellis

feat: new submission test, bad ink config for negative test

parent 5630dbef
......@@ -142,5 +142,15 @@ module.exports = {
'editoria-typescript': '2',
},
},
'bad-pubsweet-component-ink-backend': {
inkEndpoint:
process.env.INK_ENDPOINT || 'http://inkdemo-api.coko.foundation/',
email: process.env.INK_USERNAME,
password: process.env.INK_PASSWORD,
maxRetries: 500,
recipes: {
'editoria-typescript': '0',
},
},
publicKeys: ['pubsweet-client', 'authsome', 'validations'],
}
......@@ -20,7 +20,7 @@ fixture
})
.afterEach(teardown)
test('Manage submissions journey, create new submission', async t => {
test.skip('Manage submissions journey, create new submission', async t => {
await t.expect(Selector(dashboard.mySubmissionsTitle).exists).notOk()
await t
......@@ -114,11 +114,26 @@ test('Manage submissions journey, create new submission', async t => {
.ok()
})
test.skip('Manage submissions journey, failed new submission', async t => {
test.before(async t => {
startServer
const result = await setup()
config.util.extendDeep(
{},
JSON.parse(JSON.stringify(config.get('pubsweet-component-ink-backend'))),
JSON.parse(
JSON.stringify(config.get('bad-pubsweet-component-ink-backend')),
),
)
author = result.userData
await login.doLogin(author.username, author.password)
})('Manage submissions journey, failed new submission', async t => {
await t
.setFilesToUpload(dashboard.createSubmission, ['./testSubmission2.txt']) //setFilesToUpload error automatically causes test to fail
.expect(await Selector(dashboard.submitError).exists)
.ok()
.setFilesToUpload(dashboard.createSubmission, ['./testSubmission1.docx'])
.wait(1560)
.expect(await Selector(dashboard.uploadError).innerText)
.eql('Internal Server Error')
await t.wait(1000).expect(dashboard.createSubmission).exists
await t.wait(3000).expect(dashboard.createSubmission).exists
})
......@@ -8,9 +8,7 @@ const dashboard = {
createSubmission: Selector('input'),
input: Selector('input[type=file]'),
submitError: Selector('div').withText(
'There was an error uploading the file',
),
uploadError: Selector('#root div div div div'),
mySubmissionsTitle: Selector('#root div div div div').child(2),
mySubmissions: Selector('#root div div div div'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment