mirror of
https://github.com/TryGhost/Ghost-Admin.git
synced 2023-12-14 02:33:04 +01:00
Fixed signup acceptance tests
This commit is contained in:
parent
29d8755a1d
commit
fd973f60ab
|
@ -44,9 +44,11 @@
|
||||||
autocomplete="username email"
|
autocomplete="username email"
|
||||||
value=(readonly signupDetails.email)
|
value=(readonly signupDetails.email)
|
||||||
input=(action (mut signupDetails.email) value="target.value")
|
input=(action (mut signupDetails.email) value="target.value")
|
||||||
|
focus-out=(action "validate" "email")
|
||||||
data-test-input="email"
|
data-test-input="email"
|
||||||
}}
|
}}
|
||||||
</span>
|
</span>
|
||||||
|
{{gh-error-message errors=signupDetails.errors property="email"}}
|
||||||
{{/gh-form-group}}
|
{{/gh-form-group}}
|
||||||
|
|
||||||
{{#gh-form-group errors=signupDetails.errors hasValidated=signupDetails.hasValidated property="password"}}
|
{{#gh-form-group errors=signupDetails.errors hasValidated=signupDetails.hasValidated property="password"}}
|
||||||
|
|
|
@ -43,17 +43,6 @@ describe('Acceptance: Signup', function () {
|
||||||
|
|
||||||
expect(currentRouteName()).to.equal('signup');
|
expect(currentRouteName()).to.equal('signup');
|
||||||
|
|
||||||
// email address should be pre-filled and disabled
|
|
||||||
expect(
|
|
||||||
find('[data-test-input="email"]').value,
|
|
||||||
'email field value'
|
|
||||||
).to.equal('kevin+test2@ghost.org');
|
|
||||||
|
|
||||||
expect(
|
|
||||||
find('[data-test-input="email"]').matches(':disabled'),
|
|
||||||
'email field is disabled'
|
|
||||||
).to.be.true;
|
|
||||||
|
|
||||||
// focus out in Name field triggers inline error
|
// focus out in Name field triggers inline error
|
||||||
await blur('[data-test-input="name"]');
|
await blur('[data-test-input="name"]');
|
||||||
|
|
||||||
|
@ -81,6 +70,33 @@ describe('Acceptance: Signup', function () {
|
||||||
'name field error is removed after text input'
|
'name field error is removed after text input'
|
||||||
).to.be.empty;
|
).to.be.empty;
|
||||||
|
|
||||||
|
// focus out in Email field triggers inline error
|
||||||
|
await blur('[data-test-input="email"]');
|
||||||
|
|
||||||
|
expect(
|
||||||
|
find('[data-test-input="email"]').closest('.form-group'),
|
||||||
|
'email field group has error class when empty'
|
||||||
|
).to.have.class('error');
|
||||||
|
|
||||||
|
expect(
|
||||||
|
find('[data-test-input="email"]').closest('.form-group').querySelector('.response').textContent,
|
||||||
|
'email inline-error text'
|
||||||
|
).to.have.string('Please enter an email');
|
||||||
|
|
||||||
|
// entering text in email field clears error
|
||||||
|
await fillIn('[data-test-input="email"]', 'kevin+test2@ghost.org');
|
||||||
|
await blur('[data-test-input="email"]');
|
||||||
|
|
||||||
|
expect(
|
||||||
|
find('[data-test-input="email"]').closest('.form-group'),
|
||||||
|
'email field loses error class after text input'
|
||||||
|
).to.not.have.class('error');
|
||||||
|
|
||||||
|
expect(
|
||||||
|
find('[data-test-input="email"]').closest('.form-group').querySelector('.response').textContent.trim(),
|
||||||
|
'email field error is removed after text input'
|
||||||
|
).to.be.empty;
|
||||||
|
|
||||||
// check password validation
|
// check password validation
|
||||||
// focus out in password field triggers inline error
|
// focus out in password field triggers inline error
|
||||||
// no password
|
// no password
|
||||||
|
|
Loading…
Reference in a new issue