https://github.com/afassoftware/maquette-query
Query utility for maquette's virtual DOM
https://github.com/afassoftware/maquette-query
Last synced: 2 months ago
JSON representation
Query utility for maquette's virtual DOM
- Host: GitHub
- URL: https://github.com/afassoftware/maquette-query
- Owner: AFASSoftware
- License: mit
- Created: 2016-02-15T20:17:34.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2023-01-08T13:53:52.000Z (almost 3 years ago)
- Last Synced: 2025-09-21T17:40:33.247Z (3 months ago)
- Language: TypeScript
- Size: 651 KB
- Stars: 7
- Watchers: 13
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# maquette-query
Query utility for maquette's virtual DOM
First of all, querying a virtual DOM makes no sense in production code.
There is however one area that benefits from querying: unit tests.
Maquette-query makes unit testing both easy and expressive.
Maquette-query provides a `querySelector`-like API to query the virtual DOM.
It also facilitate firing events for common user interactions.
Consider the following code to test the 'hello you' demonstration from [maquettejs.org](http://maquettejs.org).
```
let projector = createTestProjector(renderMaquette);
let input = projector.query('input');
let output = projector.query('.output');
input.simulate.input({ value: 'John' });
expect(output.textContent).to.equal('Hello John!');
```
For the complete sourcecode see [here](test/demo-tests.ts)
If you find anything missing, do not hesitate to issue a pull request.