mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Run yarn run lint --fix
This commit is contained in:
parent
fec665eaf4
commit
01f5cfd481
@ -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,31 +82,47 @@ 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')
|
||||||
cy.wrap(last_column)
|
.should('have.length', 3)
|
||||||
const values = last_column.map((i, td) => parseInt(td.textContent)).toArray()
|
const last_column = cy
|
||||||
const ordered_descending = values.slice(0).sort((a,b) => b - a)
|
.get('tbody')
|
||||||
return cy.wrap(values).should('deep.eq', ordered_descending)
|
.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
|
// 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')
|
||||||
cy.wrap(last_column)
|
.should('have.length', 4)
|
||||||
const values = last_column.map((i, td) => parseInt(td.textContent)).toArray()
|
const last_column = cy
|
||||||
const ordered_descending = values.slice(0).sort((a,b) => b - a)
|
.get('tbody')
|
||||||
return cy.wrap(values).should('deep.eq', ordered_descending)
|
.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)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -27,7 +27,7 @@ export const mutations = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const getters = {
|
export const getters = {
|
||||||
isAuthenticated(state){
|
isAuthenticated(state) {
|
||||||
return !!state.token
|
return !!state.token
|
||||||
},
|
},
|
||||||
isLoggedIn(state) {
|
isLoggedIn(state) {
|
||||||
|
|||||||
@ -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.eyJpZCI6InUxIiwic2x1ZyI6InBldGVyLWx1c3RpZyIsIm5hbWUiOiJQZXRlciBMdXN0aWciLCJhdmF0YXIiOiJodHRwczovL3MzLmFtYXpvbmF3cy5jb20vdWlmYWNlcy9mYWNlcy90d2l0dGVyL25haXRhbmFtb3Jlbm8vMTI4LmpwZyIsImVtYWlsIjoiYWRtaW5AZXhhbXBsZS5vcmciLCJyb2xlIjoiYWRtaW4iLCJpYXQiOjE1NDUwNjMzODcsImV4cCI6MTYzMTQ2MzM4NywiYXVkIjoiaHR0cHM6Ly9uaXRyby1zdGFnaW5nLmh1bWFuLWNvbm5lY3Rpb24ub3JnIiwiaXNzIjoiaHR0cHM6Ly9hcGktbml0cm8tc3RhZ2luZy5odW1hbi1jb25uZWN0aW9uLm9yZyIsInN1YiI6InUxIn0.BQEoC3J6uRqMvIVfHYmMbmfMR2BudiG5Xvn8mfcc0Kk'
|
||||||
}
|
}
|
||||||
expect(getters.isAuthenticated(state)).toBe(true)
|
expect(getters.isAuthenticated(state)).toBe(true)
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user