It's TDD time. Let's write more tests into RegisterPage.spec.js. The tests we need to create include the following:
- Test the initial values of the data model
- Test the binding between the form input fields and the data model
- Test the existence of the event handler of the form
Including the previous test, which is used to verify the form's rendering, we will have four tests in this specification. It's time to do some refactoring to the test specification itself. As mentioned earlier, we will also use vue-test-utils, the official unit testing utility library for Vue.js. Let's use the following command to install the library before we start the refactoring:
npm install @vue/test-utils --save-dev
Once that is done, ...