lundi 18 novembre 2019

Write Ember Octane Component test to check if state is correct after I submit a form?

I want to write a test such that when I submit a string, then a @tracked array =[0,0,0] field will change. I have a simple <Textarea @value= ></Textarea> for hbs.
if input is 1 then the tracked array becomes [0,1,0]. How do I do this?? So far I have the following code that DOESN'T work:

import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { click, render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';

module('Integration | Component | array', function(hooks) {
    setupRenderingTest(hooks);



    test('Textarea should display PLACE [0,1,0]"', async function(assert) {

        await render(hbs`<Array />`);
        assert.equal(find('textarea').value, 'testing"')
      });

});



Aucun commentaire:

Enregistrer un commentaire