lundi 30 juillet 2018

How is helper 'andThen' in embers different than traditional 'then'

In the code below, I can use then instead of andThen and I see everything is running fine. So, what makes andThen special?

test('Clicked on the About page /about', function(assert) {
    visit('/')
    .click('a:contains("About")')
    .then(function(){
        assert.equal(currentURL(), '/about', 'SHould Navigate to about')
    })
});

test('Clicked on the About page /about', function(assert) {
    visit('/')
    .click('a:contains("About")')
    .andThen(function(){
        assert.equal(currentURL(), '/about', 'SHould Navigate to about')
    })
});




Aucun commentaire:

Enregistrer un commentaire