11import { module , test } from 'qunit' ;
2- import { click , fillIn , currentURL , find , visit } from '@ember/test-helpers' ;
2+ import { click , fillIn , currentURL , visit } from '@ember/test-helpers' ;
33import { setupApplicationTest } from 'ember-qunit' ;
44
55module ( 'Acceptance | application' , function ( hooks ) {
@@ -11,28 +11,28 @@ module('Acceptance | application', function(hooks) {
1111 assert . equal ( currentURL ( ) , '/' ) ;
1212
1313 // Init: Buffer's and content's property value are the same
14- assert . equal ( find ( '#buffer-firstname' ) . textContent , 'stefan' ) ;
15- assert . equal ( find ( '#user-firstname' ) . textContent , 'stefan' ) ;
16- assert . equal ( find ( '#buffer-email' ) . textContent , 'example@example.com' ) ;
17- assert . equal ( find ( '#user-email' ) . textContent , 'example@example.com' ) ;
18- assert . equal ( find ( '#buffer-has-changes' ) . textContent , 'false' ) ;
14+ assert . dom ( '#buffer-firstname' ) . hasText ( 'stefan' ) ;
15+ assert . dom ( '#user-firstname' ) . hasText ( 'stefan' ) ;
16+ assert . dom ( '#buffer-email' ) . hasText ( 'example@example.com' ) ;
17+ assert . dom ( '#user-email' ) . hasText ( 'example@example.com' ) ;
18+ assert . dom ( '#buffer-has-changes' ) . hasText ( 'false' ) ;
1919
2020 // Change buffer value: there should be a difference between buffer and content
2121 await fillIn ( '#firstname-input' , 'tomek' ) ;
2222 await fillIn ( '#email-input' , 'test@dot.com' ) ;
23- assert . equal ( find ( '#buffer-firstname' ) . textContent , 'tomek' ) ;
24- assert . equal ( find ( '#user-firstname' ) . textContent , 'stefan' ) ;
25- assert . equal ( find ( '#buffer-email' ) . textContent , 'test@dot.com' ) ;
26- assert . equal ( find ( '#user-email' ) . textContent , 'example@example.com' ) ;
27- assert . equal ( find ( '#buffer-has-changes' ) . textContent , 'true' ) ;
23+ assert . dom ( '#buffer-firstname' ) . hasText ( 'tomek' ) ;
24+ assert . dom ( '#user-firstname' ) . hasText ( 'stefan' ) ;
25+ assert . dom ( '#buffer-email' ) . hasText ( 'test@dot.com' ) ;
26+ assert . dom ( '#user-email' ) . hasText ( 'example@example.com' ) ;
27+ assert . dom ( '#buffer-has-changes' ) . hasText ( 'true' ) ;
2828
2929 // Apply buffer changes and verify if content has new values
3030 await click ( 'button#apply-changes' ) ;
31- assert . equal ( find ( '#buffer-firstname' ) . textContent , 'tomek' ) ;
32- assert . equal ( find ( '#user-firstname' ) . textContent , 'tomek' ) ;
33- assert . equal ( find ( '#buffer-email' ) . textContent , 'test@dot.com' ) ;
34- assert . equal ( find ( '#user-email' ) . textContent , 'test@dot.com' ) ;
35- assert . equal ( find ( '#buffer-has-changes' ) . textContent , 'false' ) ;
31+ assert . dom ( '#buffer-firstname' ) . hasText ( 'tomek' ) ;
32+ assert . dom ( '#user-firstname' ) . hasText ( 'tomek' ) ;
33+ assert . dom ( '#buffer-email' ) . hasText ( 'test@dot.com' ) ;
34+ assert . dom ( '#user-email' ) . hasText ( 'test@dot.com' ) ;
35+ assert . dom ( '#buffer-has-changes' ) . hasText ( 'false' ) ;
3636 } ) ;
3737
3838 test ( 'verify if partial changes were applied' , async function ( assert ) {
@@ -41,36 +41,36 @@ module('Acceptance | application', function(hooks) {
4141 assert . equal ( currentURL ( ) , '/' ) ;
4242
4343 // Init: Buffer's and content's property value are the same
44- assert . equal ( find ( '#buffer-firstname' ) . textContent , 'stefan' ) ;
45- assert . equal ( find ( '#user-firstname' ) . textContent , 'stefan' ) ;
46- assert . equal ( find ( '#buffer-email' ) . textContent , 'example@example.com' ) ;
47- assert . equal ( find ( '#user-email' ) . textContent , 'example@example.com' ) ;
48- assert . equal ( find ( '#buffer-has-changes' ) . textContent , 'false' ) ;
44+ assert . dom ( '#buffer-firstname' ) . hasText ( 'stefan' ) ;
45+ assert . dom ( '#user-firstname' ) . hasText ( 'stefan' ) ;
46+ assert . dom ( '#buffer-email' ) . hasText ( 'example@example.com' ) ;
47+ assert . dom ( '#user-email' ) . hasText ( 'example@example.com' ) ;
48+ assert . dom ( '#buffer-has-changes' ) . hasText ( 'false' ) ;
4949
5050 // Change buffer value: there should be a difference between buffer and content
5151 await fillIn ( '#firstname-input' , 'tomek' ) ;
5252 await fillIn ( '#email-input' , 'test@dot.com' ) ;
53- assert . equal ( find ( '#buffer-firstname' ) . textContent , 'tomek' ) ;
54- assert . equal ( find ( '#user-firstname' ) . textContent , 'stefan' ) ;
55- assert . equal ( find ( '#buffer-email' ) . textContent , 'test@dot.com' ) ;
56- assert . equal ( find ( '#user-email' ) . textContent , 'example@example.com' ) ;
57- assert . equal ( find ( '#buffer-has-changes' ) . textContent , 'true' ) ;
53+ assert . dom ( '#buffer-firstname' ) . hasText ( 'tomek' ) ;
54+ assert . dom ( '#user-firstname' ) . hasText ( 'stefan' ) ;
55+ assert . dom ( '#buffer-email' ) . hasText ( 'test@dot.com' ) ;
56+ assert . dom ( '#user-email' ) . hasText ( 'example@example.com' ) ;
57+ assert . dom ( '#buffer-has-changes' ) . hasText ( 'true' ) ;
5858
5959 // Apply buffer changes and verify if content has new values
6060 await click ( 'button#apply-partial-changes' ) ;
61- assert . equal ( find ( '#buffer-firstname' ) . textContent , 'tomek' ) ;
62- assert . equal ( find ( '#user-firstname' ) . textContent , 'stefan' ) ;
63- assert . equal ( find ( '#buffer-email' ) . textContent , 'test@dot.com' ) ;
64- assert . equal ( find ( '#user-email' ) . textContent , 'test@dot.com' ) ;
65- assert . equal ( find ( '#buffer-has-changes' ) . textContent , 'true' , 'still has changes to apply' ) ;
61+ assert . dom ( '#buffer-firstname' ) . hasText ( 'tomek' ) ;
62+ assert . dom ( '#user-firstname' ) . hasText ( 'stefan' ) ;
63+ assert . dom ( '#buffer-email' ) . hasText ( 'test@dot.com' ) ;
64+ assert . dom ( '#user-email' ) . hasText ( 'test@dot.com' ) ;
65+ assert . dom ( '#buffer-has-changes' ) . hasText ( 'true' , 'still has changes to apply' ) ;
6666
6767 // Discard changes - we expect firstname to be back to original value
6868 // But the change that was already applied, should remain
6969 await click ( 'button#discard-changes' ) ;
70- assert . equal ( find ( '#buffer-firstname' ) . textContent , 'stefan' ) ;
71- assert . equal ( find ( '#user-firstname' ) . textContent , 'stefan' ) ;
72- assert . equal ( find ( '#buffer-email' ) . textContent , 'test@dot.com' ) ;
73- assert . equal ( find ( '#user-email' ) . textContent , 'test@dot.com' ) ;
74- assert . equal ( find ( '#buffer-has-changes' ) . textContent , 'false' ) ;
70+ assert . dom ( '#buffer-firstname' ) . hasText ( 'stefan' ) ;
71+ assert . dom ( '#user-firstname' ) . hasText ( 'stefan' ) ;
72+ assert . dom ( '#buffer-email' ) . hasText ( 'test@dot.com' ) ;
73+ assert . dom ( '#user-email' ) . hasText ( 'test@dot.com' ) ;
74+ assert . dom ( '#buffer-has-changes' ) . hasText ( 'false' ) ;
7575 } ) ;
7676} ) ;
0 commit comments