Vue-form-generator: Create unit tests for new fields

Created on 21 Aug 2016  Â·  34Comments  Â·  Source: vue-generators/vue-form-generator

  • [x] fieldCleave
  • [x] fieldMasked
  • [x] fieldNoUiSlider
  • [x] fieldPikaday
  • [x] fieldSlider
  • [x] fieldSpektrum
  • [x] fieldVueMultiSelect
  • [x] fieldGoogleAddress
enhancement medium

Most helpful comment

All test done. :tada:

I made some changes, so if you open the karma debug page ( http://localhost:9877/debug.html ) for test debugging, you will see a similar page instead of empty white blank page :smile:
image

All 34 comments

I'm going to try after I read a bit more about Karma

OK, but firstly I have to solve the external lib loading problem.

I added external libs to karma. So now can be improve new fields unit tests. https://github.com/icebob/vue-form-generator/commit/776f6c479fec8105df55d69288a310cf58b2386c

(I was about to suggest that :smile: )


Passing arrow functions (“lambdas”) to Mocha is discouraged

From the doc
Should we change that ?

Oooo.... what?!?!

basically, don't do this:

describe('my suite', () => {
  it('my test', () => {
    // should set the timeout of this test to 1000 ms; instead will fail
    this.timeout(1000);
    assert.ok(true);
  });
});

but this:

describe('my suite', function() {
  it('my test', function() {
    this.timeout(1000);
    assert.ok(true);
  });
});

You can use arrows because we use webpack as preprocessor and webpack use babel

Unit test are going through Webpack ? Wow ok, I didn't know... Webpack does everything :astonished:

Sorry, I missed that totally

Nop, so you can use any ES6 feature

Sweet!

what field test are you make? Because I plan to make an other field tests

I'm starting with #36

What we need to test in this external fields:

  • [ ] check HTML elements (example: https://github.com/icebob/vue-form-generator/blob/master/test/unit/specs/fields/fieldSelect.spec.js#L48 )
  • [ ] after init check the lib read the value from model and value is correct (example: https://github.com/icebob/vue-form-generator/blob/master/test/unit/specs/fields/fieldSelect.spec.js#L63 )
  • [ ] if model value changed, check the lib got the new value (example: https://github.com/icebob/vue-form-generator/blob/master/test/unit/specs/fields/fieldSelect.spec.js#L78 )
  • [ ] if lib value changed (via HTML element, maye need a trigger with js), check the model got the value (example: https://github.com/icebob/vue-form-generator/blob/master/test/unit/specs/fields/fieldSelect.spec.js#L87 )

I make fieldMasked and fieldSpektrum

I'm going to try fieldVueMultiSelect even if fieldNoUiSlider is not finished

Ok, for multiselect I recommend you to use fieldSelectEx.spec.js as a base

Roger that ! :)

Le 23 aoĂ»t 2016 16:46, "Icebob" [email protected] a Ă©crit :

Ok, for multiselect I recommend you to use fieldSelect.spec.js as a base

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/icebob/vue-form-generator/issues/40#issuecomment-241755645,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADT81G25O1xKPQyHtgIWx081dxjo6zNEks5qiwfcgaJpZM4JpX4g
.

46 I did something wrong with the branch (a bad rebase), so this one contain a lot a commit from #44.

I hope it's ok.

Ok, #46 & #44 merged

It was too early for #44, I made several mistakes that I'm fixing

Ok, just #46 contains #44 because both was in the same branch, so I can only merge both

My bad sorry about that

Nop :)

fieldMasked done.

fieldPikaday, fieldSlider done.

fieldSpectrum done.

fieldGoogleAddress "done"

Wow cool, you are on :fire:

Now I start the last fieldCleave too.

All test done. :tada:

I made some changes, so if you open the karma debug page ( http://localhost:9877/debug.html ) for test debugging, you will see a similar page instead of empty white blank page :smile:
image

That's so cool ! I need your help with the doc:

  • [ ] visible & disabled, values schema functions description
  • [ ] fieldSubmit
  • [ ] customizable styles

I hope we can finish everything early next week.

Merged #51

Was this page helpful?
0 / 5 - 0 ratings

Related issues

blackfyre picture blackfyre  Â·  4Comments

DelfsEngineering picture DelfsEngineering  Â·  4Comments

ndro picture ndro  Â·  4Comments

LouWii picture LouWii  Â·  4Comments

Stephen9s picture Stephen9s  Â·  4Comments