feat: create a guild (#1)
This commit is contained in:
37
cypress/integration/pages/application/guilds/create.spec.ts
Normal file
37
cypress/integration/pages/application/guilds/create.spec.ts
Normal file
@ -0,0 +1,37 @@
|
||||
import { channel } from '../../../../fixtures/channels/channel'
|
||||
import { guild } from '../../../../fixtures/guilds/guild'
|
||||
import { postGuildsHandler } from '../../../../fixtures/guilds/post'
|
||||
import { authenticationHandlers } from '../../../../fixtures/handler'
|
||||
|
||||
describe('Pages > /application/guilds/create', () => {
|
||||
beforeEach(() => {
|
||||
cy.task('stopMockServer')
|
||||
})
|
||||
|
||||
it('should succeeds and create the guild', () => {
|
||||
cy.task('startMockServer', [
|
||||
...authenticationHandlers,
|
||||
postGuildsHandler
|
||||
]).setCookie('refreshToken', 'refresh-token')
|
||||
cy.visit('/application/guilds/create')
|
||||
cy.get('#error-name').should('not.exist')
|
||||
cy.get('[data-cy=input-name]').type(guild.name)
|
||||
cy.get('[data-cy=submit]').click()
|
||||
cy.location('pathname').should(
|
||||
'eq',
|
||||
`/application/${guild.id}/${channel.id}`
|
||||
)
|
||||
})
|
||||
|
||||
it('should fails with internal api server error', () => {
|
||||
cy.task('startMockServer', [...authenticationHandlers]).setCookie(
|
||||
'refreshToken',
|
||||
'refresh-token'
|
||||
)
|
||||
cy.visit('/application/guilds/create')
|
||||
cy.get('#error-name').should('not.exist')
|
||||
cy.get('[data-cy=input-name]').type(guild.name)
|
||||
cy.get('[data-cy=submit]').click()
|
||||
cy.get('#message').should('have.text', 'Error: Internal Server Error.')
|
||||
})
|
||||
})
|
@ -40,6 +40,9 @@ describe('Pages > /authentication/reset-password', () => {
|
||||
cy.visit('/authentication/reset-password')
|
||||
cy.get('#message').should('not.exist')
|
||||
cy.get('[data-cy=submit]').click()
|
||||
cy.get('#message').should('have.text', 'Error: Invalid value.')
|
||||
cy.get('#message').should(
|
||||
'have.text',
|
||||
'Error: Oops, this field is required 🙈.'
|
||||
)
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user