refactor: Backbone for passing JS and CSS variables (#861)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Juro Oravec 2024-12-28 19:27:19 +01:00 committed by GitHub
parent 296da4a1e8
commit fe67d90547
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 1181 additions and 594 deletions

View file

@ -215,7 +215,7 @@ class CallComponentTests(_BaseDepManagerTestCase):
const inputHash = 'input-abc';
// Pretend that this HTML belongs to our component
document.body.insertAdjacentHTML('beforeend', '<div data-comp-id-12345> abc </div>');
document.body.insertAdjacentHTML('beforeend', '<div data-djc-id-12345> abc </div>');
let captured = null;
manager.registerComponent(compName, (data, ctx) => {
@ -248,7 +248,7 @@ class CallComponentTests(_BaseDepManagerTestCase):
"hello": "world",
},
"ctx": {
"els": ['<div data-comp-id-12345=""> abc </div>'],
"els": ['<div data-djc-id-12345=""> abc </div>'],
"id": "12345",
"name": "my_comp",
},
@ -269,7 +269,7 @@ class CallComponentTests(_BaseDepManagerTestCase):
const inputHash = 'input-abc';
// Pretend that this HTML belongs to our component
document.body.insertAdjacentHTML('beforeend', '<div data-comp-id-12345> abc </div>');
document.body.insertAdjacentHTML('beforeend', '<div data-djc-id-12345> abc </div>');
manager.registerComponent(compName, (data, ctx) => {
return Promise.resolve(123);
@ -309,7 +309,7 @@ class CallComponentTests(_BaseDepManagerTestCase):
const inputHash = 'input-abc';
// Pretend that this HTML belongs to our component
document.body.insertAdjacentHTML('beforeend', '<div data-comp-id-12345> abc </div>');
document.body.insertAdjacentHTML('beforeend', '<div data-djc-id-12345> abc </div>');
manager.registerComponent(compName, (data, ctx) => {
throw Error('Oops!');
@ -343,7 +343,7 @@ class CallComponentTests(_BaseDepManagerTestCase):
const inputHash = 'input-abc';
// Pretend that this HTML belongs to our component
document.body.insertAdjacentHTML('beforeend', '<div data-comp-id-12345> abc </div>');
document.body.insertAdjacentHTML('beforeend', '<div data-djc-id-12345> abc </div>');
manager.registerComponent(compName, async (data, ctx) => {
throw Error('Oops!');
@ -408,7 +408,7 @@ class CallComponentTests(_BaseDepManagerTestCase):
const compId = '12345';
const inputHash = 'input-abc';
document.body.insertAdjacentHTML('beforeend', '<div data-comp-id-12345> abc </div>');
document.body.insertAdjacentHTML('beforeend', '<div data-djc-id-12345> abc </div>');
manager.registerComponent(compName, (data, ctx) => {
return Promise.resolve(123);
@ -434,7 +434,7 @@ class CallComponentTests(_BaseDepManagerTestCase):
const compId = '12345';
const inputHash = 'input-abc';
document.body.insertAdjacentHTML('beforeend', '<div data-comp-id-12345> abc </div>');
document.body.insertAdjacentHTML('beforeend', '<div data-djc-id-12345> abc </div>');
manager.registerComponentData(compName, inputHash, () => {
return { hello: 'world' };