2022-12-15 21:35:17 +00:00
|
|
|
import {createFakeUserAndLogin} from '../../support/authenticateUser'
|
|
|
|
|
2020-12-10 13:52:35 +00:00
|
|
|
import {TaskFactory} from '../../factories/task'
|
2022-11-13 21:04:57 +00:00
|
|
|
import {ProjectFactory} from '../../factories/project'
|
2020-12-10 13:52:35 +00:00
|
|
|
import {NamespaceFactory} from '../../factories/namespace'
|
2022-11-13 21:04:57 +00:00
|
|
|
import {UserProjectFactory} from '../../factories/users_project'
|
2020-12-10 13:52:35 +00:00
|
|
|
|
|
|
|
describe('Editor', () => {
|
2022-12-15 21:35:17 +00:00
|
|
|
createFakeUserAndLogin()
|
|
|
|
|
2020-12-10 13:52:35 +00:00
|
|
|
beforeEach(() => {
|
|
|
|
NamespaceFactory.create(1)
|
2022-11-13 21:04:57 +00:00
|
|
|
ProjectFactory.create(1)
|
2020-12-10 13:52:35 +00:00
|
|
|
TaskFactory.truncate()
|
2022-11-13 21:04:57 +00:00
|
|
|
UserProjectFactory.truncate()
|
2020-12-10 13:52:35 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
it('Has a preview with checkable checkboxes', () => {
|
|
|
|
const tasks = TaskFactory.create(1, {
|
|
|
|
description: `# Test Heading
|
|
|
|
* Bullet 1
|
|
|
|
* Bullet 2
|
|
|
|
|
|
|
|
* [ ] Checklist
|
|
|
|
* [x] Checklist checked
|
|
|
|
`,
|
|
|
|
})
|
|
|
|
|
|
|
|
cy.visit(`/tasks/${tasks[0].id}`)
|
|
|
|
cy.get('input[type=checkbox][data-checkbox-num=0]')
|
|
|
|
.click()
|
|
|
|
|
|
|
|
cy.get('.task-view .details.content.description h3 span.is-small.has-text-success')
|
|
|
|
.contains('Saved!')
|
|
|
|
.should('exist')
|
|
|
|
cy.get('.preview.content')
|
|
|
|
.should('contain', 'Test Heading')
|
|
|
|
})
|
|
|
|
})
|