diff --git a/frontend/src/components/UserSettings/UserName.spec.js b/frontend/src/components/UserSettings/UserName.spec.js index 2fff0e4e7..ada3400f0 100644 --- a/frontend/src/components/UserSettings/UserName.spec.js +++ b/frontend/src/components/UserSettings/UserName.spec.js @@ -91,27 +91,10 @@ describe('UserName Form', () => { }) }) - describe('has a username', () => { + describe('edit username', async () => { beforeEach(async () => { - mocks.$store.state.username = 'petra' - wrapper.setData({ isEdit: true }) - }) - it('has no the username', () => { - expect(wrapper.find('[data-test="username-input-group"]')).toBeTruthy() - }) - - it(' has no username-alert text ', () => { - expect(wrapper.find('[data-test="username-alert"]').exists()).toBe(false) - }) - - it('has no component username change ', () => { - expect(wrapper.findComponent({ name: 'InputUsername' }).exists()).toBeTruthy() - }) - }) - - describe.skip('edit username', () => { - beforeEach(async () => { - wrapper.findComponent({ name: 'InputUsername' }).setValue('petra') + // wrapper.findComponent({ name: 'InputUsername' }).setValue('petra') + await wrapper.setData({ username: 'petra', isEdit: true }) }) it('has a submit button', () => { @@ -180,6 +163,24 @@ describe('UserName Form', () => { }) }) }) + + describe('has a username', () => { + beforeEach(async () => { + mocks.$store.state.username = 'petra' + wrapper.setData({ isEdit: true }) + }) + it('has no the username', () => { + expect(wrapper.find('[data-test="username-input-group"]')).toBeTruthy() + }) + + it(' has no username-alert text ', () => { + expect(wrapper.find('[data-test="username-alert"]').exists()).toBe(false) + }) + + it('has no component username change ', () => { + expect(wrapper.findComponent({ name: 'InputUsername' }).exists()).toBeTruthy() + }) + }) }) }) }) diff --git a/frontend/src/components/UserSettings/UserName.vue b/frontend/src/components/UserSettings/UserName.vue index 69363b8ef..7e56536d8 100644 --- a/frontend/src/components/UserSettings/UserName.vue +++ b/frontend/src/components/UserSettings/UserName.vue @@ -3,7 +3,11 @@