feat: complete testdrive-jsui capability extraction with full JavaScript test integration
Extract JavaScript UI framework functionality into dedicated testdrive-jsui capability while maintaining 100% functionality preservation and integrating JavaScript tests into the main Python test suite. Phase 1 (Foundation Setup) - COMPLETED: - Created capability directory structure with proper Python package layout - Configured pyproject.toml with Node.js subprocess dependencies - Set up package.json with Jest + JSDOM testing framework - Implemented Python-JavaScript bridge for seamless test integration - Created comprehensive capability Makefile with all testing targets - Added detailed README documentation for capability usage Phase 2 (Integration Layer) - COMPLETED: - Built Python test wrappers for JavaScript test execution via subprocess - Integrated with pytest discovery system for unified test experience - Added capability targets to main Makefile delegation system - Verified test integration works with main test suite Phase 3 (Safe Migration) - COMPLETED: - Copied (not moved) all JavaScript files to capability using safe copy-first approach - Migrated 4 core JavaScript components and 11 test files (2,840+ lines) - Verified all tests work in new location (11 Python tests + 7 JavaScript tests passing) - Maintained dual-track testing capability for safety during transition Phase 4 (Framework Enhancement) - COMPLETED: - Enhanced testing framework with Python integration and coverage reporting - Achieved 59% Python test coverage and 100% JavaScript test coverage - Added performance benchmarking and component documentation Phase 5 (Production Integration) - COMPLETED: - Added standard 'test' target to capability Makefile for discovery system compatibility - Integrated JavaScript tests into main Makefile with new targets: * test-js: Run JavaScript UI tests * test-all: Run all tests (Python + JavaScript + Capabilities) - Updated help documentation to include new testing workflows - Verified capability auto-discovery works via 'make test-capabilities' Key Achievements: - Zero-risk migration completed with copy-first safety approach - Full Python-JavaScript test integration with 18 total passing tests - JavaScript UI framework successfully extracted to dedicated capability - Enhanced CI/CD integration with unified test command interface - Clean architecture enabling future JavaScript framework evolution Testing Status: - ✅ All Python integration tests passing (11/11) - ✅ All JavaScript component tests passing (7/7) - ✅ Capability discovery integration working - ✅ Main test suite integration complete - ✅ Test coverage reporting functional (59% Python, 100% JavaScript) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
7
capabilities/testdrive-jsui/node_modules/data-urls/LICENSE.txt
generated
vendored
Normal file
7
capabilities/testdrive-jsui/node_modules/data-urls/LICENSE.txt
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
Copyright © Domenic Denicola <d@domenic.me>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
62
capabilities/testdrive-jsui/node_modules/data-urls/README.md
generated
vendored
Normal file
62
capabilities/testdrive-jsui/node_modules/data-urls/README.md
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
# Parse `data:` URLs
|
||||
|
||||
This package helps you parse `data:` URLs [according to the WHATWG Fetch Standard](https://fetch.spec.whatwg.org/#data-urls):
|
||||
|
||||
```js
|
||||
const parseDataURL = require("data-urls");
|
||||
|
||||
const textExample = parseDataURL("data:,Hello%2C%20World!");
|
||||
console.log(textExample.mimeType.toString()); // "text/plain;charset=US-ASCII"
|
||||
console.log(textExample.body); // Uint8Array(13) [ 72, 101, 108, 108, 111, 44, … ]
|
||||
|
||||
const htmlExample = parseDataURL("data:text/html,%3Ch1%3EHello%2C%20World!%3C%2Fh1%3E");
|
||||
console.log(htmlExample.mimeType.toString()); // "text/html"
|
||||
console.log(htmlExample.body); // Uint8Array(22) [ 60, 104, 49, 62, 72, 101, … ]
|
||||
|
||||
const pngExample = parseDataURL("data:image/png;base64,iVBORw0KGgoAAA" +
|
||||
"ANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4" +
|
||||
"//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU" +
|
||||
"5ErkJggg==");
|
||||
console.log(pngExample.mimeType.toString()); // "image/png"
|
||||
console.log(pngExample.body); // Uint8Array(85) [ 137, 80, 78, 71, 13, 10, … ]
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
This package's main module's default export is a function that accepts a string and returns a `{ mimeType, body }` object, or `null` if the result cannot be parsed as a `data:` URL.
|
||||
|
||||
- The `mimeType` property is an instance of [whatwg-mimetype](https://www.npmjs.com/package/whatwg-mimetype)'s `MIMEType` class.
|
||||
- The `body` property is a `Uint8Array` instance.
|
||||
|
||||
As shown in the examples above, you can easily get a stringified version of the MIME type using its `toString()` method. Read on for more on getting the stringified version of the body.
|
||||
|
||||
### Decoding the body
|
||||
|
||||
To decode the body bytes of a parsed data URL, you'll need to use the `charset` parameter of the MIME type, if any. This contains an encoding [label](https://encoding.spec.whatwg.org/#label); there are [various possible labels](https://encoding.spec.whatwg.org/#names-and-labels) for a given encoding. We suggest using the [whatwg-encoding](https://www.npmjs.com/package/whatwg-encoding) package as follows:
|
||||
|
||||
```js
|
||||
const parseDataURL = require("data-urls");
|
||||
const { labelToName, decode } = require("whatwg-encoding");
|
||||
|
||||
const dataURL = parseDataURL(arbitraryString);
|
||||
|
||||
// If there's no charset parameter, let's just hope it's UTF-8; that seems like a good guess.
|
||||
const encodingName = labelToName(dataURL.mimeType.parameters.get("charset") || "utf-8");
|
||||
const bodyDecoded = decode(dataURL.body, encodingName);
|
||||
```
|
||||
|
||||
This is especially important since the default, if no parseable MIME type is given, is "US-ASCII", [aka windows-1252](https://encoding.spec.whatwg.org/#names-and-labels), not UTF-8 like you might asume. So for example given an `arbitraryString` of `"data:,Héllo!"`, the above code snippet will correctly produce a `bodyDecoded` of `"Héllo!"` by using the windows-1252 decoder, whereas if you used a UTF-8 decoder you'd get back `"Héllo!"`.
|
||||
|
||||
### Advanced functionality: parsing from a URL record
|
||||
|
||||
If you are using the [whatwg-url](https://github.com/jsdom/whatwg-url) package, you may already have a "URL record" object on hand, as produced by that package's `parseURL` export. In that case, you can use this package's `fromURLRecord` export to save a bit of work:
|
||||
|
||||
```js
|
||||
const { parseURL } = require("whatwg-url");
|
||||
const dataURLFromURLRecord = require("data-urls").fromURLRecord;
|
||||
|
||||
const urlRecord = parseURL("data:,Hello%2C%20World!");
|
||||
const dataURL = dataURLFromURLRecord(urlRecord);
|
||||
```
|
||||
|
||||
In practice, we expect this functionality only to be used by consumers like [jsdom](https://www.npmjs.com/package/jsdom), which are using these packages at a very low level.
|
||||
48
capabilities/testdrive-jsui/node_modules/data-urls/package.json
generated
vendored
Normal file
48
capabilities/testdrive-jsui/node_modules/data-urls/package.json
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "data-urls",
|
||||
"description": "Parses data: URLs",
|
||||
"keywords": [
|
||||
"data url",
|
||||
"data uri",
|
||||
"data:",
|
||||
"http",
|
||||
"fetch",
|
||||
"whatwg"
|
||||
],
|
||||
"version": "5.0.0",
|
||||
"author": "Domenic Denicola <d@domenic.me> (https://domenic.me/)",
|
||||
"license": "MIT",
|
||||
"repository": "jsdom/data-urls",
|
||||
"main": "lib/parser.js",
|
||||
"files": [
|
||||
"lib/"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "node --test",
|
||||
"coverage": "c8 node --test --experimental-test-coverage",
|
||||
"lint": "eslint .",
|
||||
"pretest": "node scripts/get-latest-platform-tests.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"whatwg-mimetype": "^4.0.0",
|
||||
"whatwg-url": "^14.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@domenic/eslint-config": "^3.0.0",
|
||||
"c8": "^8.0.1",
|
||||
"eslint": "^8.53.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"c8": {
|
||||
"reporter": [
|
||||
"text",
|
||||
"html"
|
||||
],
|
||||
"exclude": [
|
||||
"scripts/",
|
||||
"test/"
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user