From 8871d2f336380fa8812b834bb918313c750f6530 Mon Sep 17 00:00:00 2001 From: Jack Huang Date: Tue, 17 Nov 2020 05:54:13 -0500 Subject: [PATCH] feat: Warn using fireEvent.input() or .change() and suggest fireEvent.update() (#166) * Add warning message to fireEvent input and change when called directly #83 * Add user event test case * Reword warning message to include used event key * Fix template literal for warning messages --- package.json | 1 + src/__tests__/components/Form.vue | 146 +++++++++++++++--------------- src/__tests__/fire-event.js | 34 +++++++ src/__tests__/form.js | 2 + src/__tests__/user-event.js | 72 +++++++++++++++ src/vue-testing-library.js | 7 ++ 6 files changed, 189 insertions(+), 73 deletions(-) create mode 100644 src/__tests__/user-event.js diff --git a/package.json b/package.json index 6c977fd9..e0e805fc 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "@babel/plugin-transform-runtime": "^7.11.5", "@testing-library/jest-dom": "^5.11.6", "@types/estree": "0.0.45", + "@testing-library/user-event": "^12.1.10", "apollo-boost": "^0.4.9", "apollo-cache-inmemory": "^1.6.6", "axios": "^0.20.0", diff --git a/src/__tests__/components/Form.vue b/src/__tests__/components/Form.vue index 78b83ca9..09f0c5e5 100644 --- a/src/__tests__/components/Form.vue +++ b/src/__tests__/components/Form.vue @@ -1,73 +1,73 @@ -