Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests for publicationYear form field #141

Closed
mfenner opened this issue Feb 24, 2019 · 4 comments
Closed

Tests for publicationYear form field #141

mfenner opened this issue Feb 24, 2019 · 4 comments
Assignees

Comments

@mfenner
Copy link
Contributor

mfenner commented Feb 24, 2019

Child of #140.

@mfenner mfenner added this to the Improve support for existing fields in Fabrica form milestone Feb 24, 2019
@kjgarza kjgarza added development and removed ready labels Feb 27, 2019
@kjgarza
Copy link
Contributor

kjgarza commented Feb 27, 2019

Started with the Rendering test but there seems to be something i'm missing, will need to investigate further.

error:

            { type: 'error',
              testContext:
               { id: 3,
                 name: 'Integration | Component | doi-form: it rejects non integers',
                 items: [],
                 state: 'executing' },
              text: 'Uncaught TypeError: Cannot read property \'get\' of undefined at http://localhost:7357/assets/bracco.js, line 2764\n' }
    ...
not ok 6 Chrome 72.0 - [178 ms] - Integration | Component | doi-form: it rejects non integers
    ---
        actual: >
            null
        stack: >
            http://localhost:7357/assets/bracco.js:2764
        message: >
            Uncaught TypeError: Cannot read property 'get' of undefined
        negative: >
            false
        Log: |
    ...


spec

  test('it rejects non integers', async function(assert) {
    assert.expect(1);

    this.set('publicationYear', 'red');
    await render(hbs`{{doi-form}}`);

    assert.equal(this.element.querySelector("div.help-block").innerText, 'Must be between 1450 and 2020.');
    assert.equal(this.element.querySelector("label.control-label.col-md-3").getAttribute('style'), 'color: #e74c3c');
  });

@mfenner
Copy link
Contributor Author

mfenner commented Feb 27, 2019

Share the complete test code. Use assert.dom. https://github.com/simplabs/qunit-dom. Run the test in the browser to see what the test is seeing.

@kjgarza
Copy link
Contributor

kjgarza commented Mar 1, 2019

Questions:

  • Can I fully separate the the form into components. Fields such as Publisher and Publicationyear are in the doi-form component. this means that we have to test the whole form to tests those component ?
    {{form.element controlType="text" label="Publisher" property="publisher" helpText="The name of the entity that
  • I would like to have very clear the Testing Specs. I prepared some intial specs Tests for Fabrica form #140 . But I would like to feedback.
  • How do we deal with refractoring?

Blockers:

  • I have not been able to render ember-bootstrap elemnts (form.element).
    • I think its because some elements do not stand on their own. for example, doesn't have the surounder form field
      {{form.element controlType="textarea" label="Title" property="titles" rows=2 helpText="A name or title by which the
      • richard pointout that I can replicate the enclosing element in the form
  • Even when adding enclosing elements. I canot render the bs-form at the moment.

@kjgarza
Copy link
Contributor

kjgarza commented Mar 12, 2019

allowed value 73fb618
multiple values N/A
missing value a261d08
incorrect value(s) a261d08
insufficient permissions N/A
adding/editing/deleting of values in c52107f

@kjgarza kjgarza closed this as completed Mar 12, 2019
@ghost ghost removed the development label Mar 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants