From 7738b26d16efe47795d5db683b22121ca1e5ebbd Mon Sep 17 00:00:00 2001 From: timdeschryver <28659384+timdeschryver@users.noreply.github.com> Date: Fri, 14 Dec 2018 20:03:03 +0100 Subject: [PATCH] feat: re-export dom-testing-library --- package.json | 2 +- projects/testing-library/src/lib/testing-library.ts | 4 ++-- projects/testing-library/src/public_api.ts | 2 +- projects/testing-library/tests/form/form.spec.ts | 7 +++++-- yarn.lock | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index cacf92e4..1d7d2dd2 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "@angular/platform-browser-dynamic": "^7.0.0", "@angular/router": "^7.0.0", "core-js": "^2.5.4", - "dom-testing-library": "^3.11.1", + "dom-testing-library": "^3.15.0", "rxjs": "^6.3.3", "zone.js": "^0.8.26" }, diff --git a/projects/testing-library/src/lib/testing-library.ts b/projects/testing-library/src/lib/testing-library.ts index f4554bba..b0db1db5 100644 --- a/projects/testing-library/src/lib/testing-library.ts +++ b/projects/testing-library/src/lib/testing-library.ts @@ -1,6 +1,6 @@ import { Component, OnInit, ElementRef } from '@angular/core'; import { TestBed } from '@angular/core/testing'; -import { getQueriesForElement, prettyDOM, fireEvent, FireObject } from 'dom-testing-library'; +import { getQueriesForElement, prettyDOM, fireEvent, FireObject, FireFunction } from 'dom-testing-library'; import { Options, RenderResult, ComponentInput } from './models'; @@ -48,7 +48,7 @@ export async function createComponent( }; return events; }, - {} as FireObject, + {} as FireFunction & FireObject, ); return { diff --git a/projects/testing-library/src/public_api.ts b/projects/testing-library/src/public_api.ts index 2cf781de..e9c2f9a4 100644 --- a/projects/testing-library/src/public_api.ts +++ b/projects/testing-library/src/public_api.ts @@ -4,4 +4,4 @@ export * from './lib/models'; export * from './lib/testing-library'; -export { fireEvent } from 'dom-testing-library'; +export * from 'dom-testing-library'; diff --git a/projects/testing-library/tests/form/form.spec.ts b/projects/testing-library/tests/form/form.spec.ts index 79100962..886bd2f8 100644 --- a/projects/testing-library/tests/form/form.spec.ts +++ b/projects/testing-library/tests/form/form.spec.ts @@ -26,8 +26,11 @@ test('login form submits using the component syntax', async () => { const submitButtonNode = getByText(/submit/i); const formNode = container.querySelector('form'); - usernameNode.value = fakeUser.username; - input(usernameNode); + input(usernameNode, { + target: { + value: fakeUser.username, + }, + }); passwordNode.value = fakeUser.password; input(passwordNode); diff --git a/yarn.lock b/yarn.lock index 9650b609..d97752ef 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2656,7 +2656,7 @@ dns-txt@^2.0.2: dependencies: buffer-indexof "^1.0.0" -dom-testing-library@^3.11.1: +dom-testing-library@^3.15.0: version "3.15.0" resolved "https://registry.yarnpkg.com/dom-testing-library/-/dom-testing-library-3.15.0.tgz#007a30afc8de32a0f5ea3d7c4bdb395999adc26e" integrity sha512-nwj+wOLFb/2H6vO4ezJRFu3B/ujk/goaEOt2K0JaarKB26rpv0VfbozL96QJx6WMrFho6cqvD9QIPdGVajpDxQ==