gristlabs_grist-core/app/client/lib/domUtils.ts
Jarosław Sadziński 58323f5313 (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
2023-08-30 21:28:06 +02:00

10 lines
320 B
TypeScript

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);
}