first commit

This commit is contained in:
Stefan Hacker
2026-04-03 09:38:48 +02:00
commit 37ad745546
47450 changed files with 3120798 additions and 0 deletions
+50
View File
@@ -0,0 +1,50 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var properties_1 = require("./properties");
describe('getNativeProps', function () {
it('can pass through data tags', function () {
var result = (0, properties_1.getNativeProps)({
'data-automation-id': 1,
}, properties_1.divProperties);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
expect(result['data-automation-id']).toEqual(1);
});
it('can pass through aria tags', function () {
var result = (0, properties_1.getNativeProps)({
'aria-label': 1,
}, properties_1.divProperties);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
expect(result['aria-label']).toEqual(1);
});
it('can pass through basic div properties and events', function () {
var result = (0, properties_1.getNativeProps)({
className: 'foo',
onClick: function () {
/* no-op */
},
onClickCapture: function () {
/* no-op */
},
}, properties_1.divProperties);
expect(result.className).toEqual('foo');
expect(typeof result.onClick).toEqual('function');
// eslint-disable-next-line @typescript-eslint/no-explicit-any
expect(typeof result.onClickCapture).toEqual('function');
});
it('can remove unexpected properties', function () {
var result = (0, properties_1.getNativeProps)({
foobar: 1,
className: 'hi',
}, properties_1.divProperties);
expect(result.className).toEqual('hi');
// eslint-disable-next-line @typescript-eslint/no-explicit-any
expect(result.foobar).toEqual(undefined);
});
it('can exclude properties', function () {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
var result = (0, properties_1.getNativeProps)({ a: 1, b: 2 }, ['a', 'b'], ['b']);
expect(result.a).toBeDefined();
expect(result.b).toBeUndefined();
});
});
//# sourceMappingURL=properties.test.js.map