add test - enable disable button on submit register

This commit is contained in:
ogerly 2021-09-28 13:47:22 +02:00
parent 1a42aa17e4
commit a8faa7b51b

View File

@ -99,7 +99,7 @@ describe('Register', () => {
}) })
it('has disabled submit button when not completely filled', () => { it('has disabled submit button when not completely filled', () => {
expect(wrapper.find('button[type="submit"]').is('[disabled]')).toBe(true) expect(wrapper.find('button[type="submit"]').attributes('disabled')).toBe('disabled')
}) })
it('displays a message that Email is required', async () => { it('displays a message that Email is required', async () => {
@ -137,6 +137,10 @@ describe('Register', () => {
wrapper.find('.language-switch-select').findAll('option').at(1).setSelected() wrapper.find('.language-switch-select').findAll('option').at(1).setSelected()
}) })
it('has enabled submit button when completely filled', () => {
expect(wrapper.find('button[type="submit"]').attributes('disabled')).toBe('disabled')
})
describe('server sends back error', () => { describe('server sends back error', () => {
beforeEach(async () => { beforeEach(async () => {
registerUserMutationMock.mockRejectedValue({ message: 'Ouch!' }) registerUserMutationMock.mockRejectedValue({ message: 'Ouch!' })