mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
fix test UserName.spec.js
This commit is contained in:
parent
537573ca94
commit
0ecc0bca3d
@ -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()
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@ -3,7 +3,11 @@
|
||||
<div v-if="!isEdit && !newUsername">
|
||||
<label>{{ $t('form.username') }}</label>
|
||||
<b-input-group class="mb-3" data-test="username-input-group">
|
||||
<b-form-input v-model="username" readonly></b-form-input>
|
||||
<b-form-input
|
||||
v-model="username"
|
||||
readonly
|
||||
data-test="username-input-readonly"
|
||||
></b-form-input>
|
||||
<b-input-group-append>
|
||||
<b-button
|
||||
size="lg"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user