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
})
Given('my account has the following details:', (table) => {
Given('my account has the following details:', table => {
// 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
})
@ -82,31 +82,47 @@ Then('I am still logged in', () => {
When('I navigate to the administration dashboard', () => {
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()
})
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
cy.get('thead').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)
const values = last_column.map((i, td) => parseInt(td.textContent)).toArray()
const ordered_descending = values.slice(0).sort((a,b) => b - a)
return cy.wrap(values).should('deep.eq', ordered_descending)
})
cy.get('thead')
.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)
const values = last_column
.map((i, td) => parseInt(td.textContent))
.toArray()
const ordered_descending = values.slice(0).sort((a, b) => b - a)
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
cy.get('thead').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)
const values = last_column.map((i, td) => parseInt(td.textContent)).toArray()
const ordered_descending = values.slice(0).sort((a,b) => b - a)
return cy.wrap(values).should('deep.eq', ordered_descending)
})
cy.get('thead')
.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)
const values = last_column
.map((i, td) => parseInt(td.textContent))
.toArray()
const ordered_descending = values.slice(0).sort((a, b) => b - a)
return cy.wrap(values).should('deep.eq', ordered_descending)
})
})

View File

@ -27,7 +27,7 @@ export const mutations = {
}
export const getters = {
isAuthenticated(state){
isAuthenticated(state) {
return !!state.token
},
isLoggedIn(state) {

View File

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