Run yarn run lint --fix

This commit is contained in:
Robert Schäfer 2018-12-17 21:45:29 +01:00
parent fec665eaf4
commit 01f5cfd481
3 changed files with 39 additions and 22 deletions

View File

@ -30,11 +30,11 @@ Given('we have a selection of tags and categories as well as posts', () => {
// TODO: use db factories instead of seed data // TODO: use db factories instead of seed data
}) })
Given('my account has the following details:', (table) => { Given('my account has the following details:', table => {
// TODO: use db factories instead of seed data // TODO: use db factories instead of seed data
}) })
Given('my user account has the role {string}', (role) => { Given('my user account has the role {string}', role => {
// TODO: use db factories instead of seed data // TODO: use db factories instead of seed data
}) })
@ -82,30 +82,46 @@ Then('I am still logged in', () => {
When('I navigate to the administration dashboard', () => { When('I navigate to the administration dashboard', () => {
cy.get('.avatar-menu').click() cy.get('.avatar-menu').click()
cy.get('a').contains('Systemverwaltung').click() cy.get('a')
.contains('Systemverwaltung')
.click()
}) })
When(`I click on {string}`, (linkOrButton) => { When(`I click on {string}`, linkOrButton => {
cy.contains(linkOrButton).click() cy.contains(linkOrButton).click()
}) })
Then('I can see a list of categories ordered by post count:', (table) => { Then('I can see a list of categories ordered by post count:', table => {
// TODO: match the table in the feature with the html table // TODO: match the table in the feature with the html table
cy.get('thead').find('tr th').should('have.length', 3) cy.get('thead')
const last_column = cy.get('tbody').find('tr td:last-child').then((last_column) => { .find('tr th')
.should('have.length', 3)
const last_column = cy
.get('tbody')
.find('tr td:last-child')
.then(last_column => {
cy.wrap(last_column) cy.wrap(last_column)
const values = last_column.map((i, td) => parseInt(td.textContent)).toArray() const values = last_column
.map((i, td) => parseInt(td.textContent))
.toArray()
const ordered_descending = values.slice(0).sort((a, b) => b - a) const ordered_descending = values.slice(0).sort((a, b) => b - a)
return cy.wrap(values).should('deep.eq', ordered_descending) return cy.wrap(values).should('deep.eq', ordered_descending)
}) })
}) })
Then('I can see a list of tags ordered by user and post count:', (table) => { Then('I can see a list of tags ordered by user and post count:', table => {
// TODO: match the table in the feature with the html table // TODO: match the table in the feature with the html table
cy.get('thead').find('tr th').should('have.length', 4) cy.get('thead')
const last_column = cy.get('tbody').find('tr td:last-child').then((last_column) => { .find('tr th')
.should('have.length', 4)
const last_column = cy
.get('tbody')
.find('tr td:last-child')
.then(last_column => {
cy.wrap(last_column) cy.wrap(last_column)
const values = last_column.map((i, td) => parseInt(td.textContent)).toArray() const values = last_column
.map((i, td) => parseInt(td.textContent))
.toArray()
const ordered_descending = values.slice(0).sort((a, b) => b - a) const ordered_descending = values.slice(0).sort((a, b) => b - a)
return cy.wrap(values).should('deep.eq', ordered_descending) return cy.wrap(values).should('deep.eq', ordered_descending)
}) })

View File

@ -6,7 +6,8 @@ describe('isAuthenticated', () => {
describe('given JWT Bearer token', () => { describe('given JWT Bearer token', () => {
test('true', () => { test('true', () => {
state = { state = {
token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6InUxIiwic2x1ZyI6InBldGVyLWx1c3RpZyIsIm5hbWUiOiJQZXRlciBMdXN0aWciLCJhdmF0YXIiOiJodHRwczovL3MzLmFtYXpvbmF3cy5jb20vdWlmYWNlcy9mYWNlcy90d2l0dGVyL25haXRhbmFtb3Jlbm8vMTI4LmpwZyIsImVtYWlsIjoiYWRtaW5AZXhhbXBsZS5vcmciLCJyb2xlIjoiYWRtaW4iLCJpYXQiOjE1NDUwNjMzODcsImV4cCI6MTYzMTQ2MzM4NywiYXVkIjoiaHR0cHM6Ly9uaXRyby1zdGFnaW5nLmh1bWFuLWNvbm5lY3Rpb24ub3JnIiwiaXNzIjoiaHR0cHM6Ly9hcGktbml0cm8tc3RhZ2luZy5odW1hbi1jb25uZWN0aW9uLm9yZyIsInN1YiI6InUxIn0.BQEoC3J6uRqMvIVfHYmMbmfMR2BudiG5Xvn8mfcc0Kk' token:
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6InUxIiwic2x1ZyI6InBldGVyLWx1c3RpZyIsIm5hbWUiOiJQZXRlciBMdXN0aWciLCJhdmF0YXIiOiJodHRwczovL3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