(core) Adding testId to the widget iframe once it receives the ready message

Summary:
Iframe with custom widget is marked with a test class `test-custom-widget-ready` when
it receives the `ready` message from the rendered widget.

Test Plan: Added and updated. Existing test should pass.

Reviewers: georgegevoian

Reviewed By: georgegevoian

Subscribers: georgegevoian

Differential Revision: https://phab.getgrist.com/D4023
This commit is contained in:
Jarosław Sadziński
2023-08-30 16:35:13 +02:00
parent daf7614fd7
commit 58323f5313
5 changed files with 71 additions and 17 deletions

View File

@@ -0,0 +1,9 @@
import {BindableValue, dom} from 'grainjs';
/**
* Version of makeTestId that can be appended conditionally.
* TODO: update grainjs typings, as this is already supported there.
*/
export function makeTestId(prefix: string) {
return (id: string, obs?: BindableValue<boolean>) => dom.cls(prefix + id, obs ?? true);
}