Skip to content

Commit

Permalink
feat: re-export dom-testing-library
Browse files Browse the repository at this point in the history
  • Loading branch information
timdeschryver committed Dec 14, 2018
1 parent e32c881 commit 7738b26
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
4 changes: 2 additions & 2 deletions projects/testing-library/src/lib/testing-library.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -48,7 +48,7 @@ export async function createComponent<T>(
};
return events;
},
{} as FireObject,
{} as FireFunction & FireObject,
);

return {
Expand Down
2 changes: 1 addition & 1 deletion projects/testing-library/src/public_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

export * from './lib/models';
export * from './lib/testing-library';
export { fireEvent } from 'dom-testing-library';
export * from 'dom-testing-library';
7 changes: 5 additions & 2 deletions projects/testing-library/tests/form/form.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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==
Expand Down

0 comments on commit 7738b26

Please sign in to comment.