Skip to content

Commit

Permalink
fix (ui): Horizontal and vertical scroll hiding elements
Browse files Browse the repository at this point in the history
Fixing the flakey tasks test
  • Loading branch information
zoesteinkamp committed Oct 31, 2019
1 parent dc171a0 commit 84dbd2b
Showing 1 changed file with 25 additions and 29 deletions.
54 changes: 25 additions & 29 deletions ui/cypress/e2e/tasks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,46 +85,42 @@ from(bucket: "${name}")
})
})

it('can disable a task', () => {
cy.get('@org').then(({id}: Organization) => {
cy.get<string>('@token').then(token => {
cy.createTask(token, id)
describe('When tasks already exsist', () => {
beforeEach(() => {
cy.get('@org').then(({id}: Organization) => {
cy.get<string>('@token').then(token => {
cy.createTask(token, id)
})
})
})

cy.getByTestID('task-card--slide-toggle').should('have.class', 'active')

cy.getByTestID('task-card--slide-toggle').click()
it('can edit a task', () => {
// Disabling the test
cy.getByTestID('task-card--slide-toggle').should('have.class', 'active')

cy.getByTestID('task-card--slide-toggle').should('not.have.class', 'active')
})
cy.getByTestID('task-card--slide-toggle').click()

it('can edit a tasks name', () => {
cy.get('@org').then(({id}: Organization) => {
cy.get<string>('@token').then(token => {
cy.createTask(token, id)
})
})

const newName = 'Task'
cy.getByTestID('task-card--slide-toggle').should(
'not.have.class',
'active'
)

cy.getByTestID('task-card').within(() => {
cy.getByTestID('task-card--name').trigger('mouseover')
// Editing a name
const newName = 'Task'

cy.getByTestID('task-card--name-button').click()
cy.getByTestID('task-card').within(() => {
cy.getByTestID('task-card--name').trigger('mouseover')

cy.get('.cf-input-field')
.type(newName)
.type('{enter}')
})
cy.getByTestID('task-card--name-button').click()

cy.fixture('routes').then(({orgs}) => {
cy.get('@org').then(({id}: Organization) => {
cy.visit(`${orgs}/${id}/tasks`)
cy.get('.cf-input-field')
.type(newName)
.type('{enter}')
})
})

cy.getByTestID('task-card').should('contain', newName)
cy.getByTestID('notification-success').should('exist')
cy.getByTestID('task-card').should('contain', newName)
})
})

describe('labeling', () => {
Expand Down

0 comments on commit 84dbd2b

Please sign in to comment.