2020-12-10 14:52:35 +01:00
|
|
|
import {UserFactory} from '../../factories/user'
|
|
|
|
|
|
|
|
import '../../support/authenticateUser'
|
|
|
|
|
|
|
|
describe('User Settings', () => {
|
|
|
|
beforeEach(() => {
|
|
|
|
UserFactory.create(1)
|
|
|
|
})
|
|
|
|
|
|
|
|
it('Changes the user avatar', () => {
|
2021-10-26 22:58:02 +02:00
|
|
|
cy.visit('/user/settings/avatar')
|
2020-12-10 14:52:35 +01:00
|
|
|
|
|
|
|
cy.get('input[name=avatarProvider][value=upload]')
|
|
|
|
.click()
|
2021-10-02 22:47:13 +02:00
|
|
|
cy.get('input[type=file]', { timeout: 1000 })
|
2020-12-10 14:52:35 +01:00
|
|
|
.attachFile('image.jpg')
|
|
|
|
cy.get('.vue-handler-wrapper.vue-handler-wrapper--south .vue-simple-handler.vue-simple-handler--south')
|
|
|
|
.trigger('mousedown', {which: 1})
|
|
|
|
.trigger('mousemove', {clientY: 100})
|
|
|
|
.trigger('mouseup')
|
2022-01-04 19:58:06 +01:00
|
|
|
cy.get('[data-cy="uploadAvatar"]')
|
2020-12-10 14:52:35 +01:00
|
|
|
.contains('Upload Avatar')
|
|
|
|
.click()
|
|
|
|
|
2020-12-18 23:52:15 +01:00
|
|
|
cy.wait(3000) // Wait for the request to finish
|
2020-12-10 14:52:35 +01:00
|
|
|
cy.get('.global-notification')
|
|
|
|
.should('contain', 'Success')
|
|
|
|
})
|
|
|
|
|
|
|
|
it('Updates the name', () => {
|
2021-10-26 22:58:02 +02:00
|
|
|
cy.visit('/user/settings/general')
|
2020-12-10 14:52:35 +01:00
|
|
|
|
2021-10-26 22:58:02 +02:00
|
|
|
cy.get('.general-settings .control input.input')
|
|
|
|
.first()
|
2020-12-10 14:52:35 +01:00
|
|
|
.type('Lorem Ipsum')
|
2022-01-04 19:58:06 +01:00
|
|
|
cy.get('[data-cy="saveGeneralSettings"]')
|
2020-12-10 14:52:35 +01:00
|
|
|
.contains('Save')
|
|
|
|
.click()
|
|
|
|
|
|
|
|
cy.get('.global-notification')
|
|
|
|
.should('contain', 'Success')
|
|
|
|
cy.get('.navbar .user .username')
|
|
|
|
.should('contain', 'Lorem Ipsum')
|
|
|
|
})
|
|
|
|
})
|