From 53078c92ed4ff680a30a1d59e05168133910b9bf Mon Sep 17 00:00:00 2001 From: sufyanAbbasi Date: Wed, 13 Nov 2024 17:11:17 -0800 Subject: [PATCH] Add testing infrastructure for anywidgets, plus test for layer_manager and layer_manager_row (#2168) * Implement LayerManager using LitElement + anywidget * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update static files * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Use non-minified JS files to work around property renaming issue * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Set up tests for layer_manager_row * Set up layer_manager_row test * Implement LayerManager using LitElement + anywidget * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update static files * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Use non-minified JS files to work around property renaming issue * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Clean up setuptools references in pyproject.toml * Clean up setuptools references in pyproject.toml * Fix dark mode and drop shadow issues in Colab * Remove common.css, load fonts using JS instead. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Rebuild * Remove extraneous files * Address comments from initial review * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Ignore static files * Fix TS errors * Convert tsconfig.json to spaces and export model interfaces * Add TS tests for anywidgets * clean up styles * Add css classes for better testability * Add better css classes (p2), build before test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Address review comments * Added a TODO for writing tests for utils. * Change single to double quote --------- Co-authored-by: Nathaniel Schmitz Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Qiusheng Wu --- js/layer_manager_row.ts | 15 +- js/utils.ts | 2 + karma.conf.cjs | 62 + package-lock.json | 5500 +++++++++++++++++++++++++++++-- package.json | 28 +- tests/fake_anywidget.ts | 21 + tests/layer_manager.spec.ts | 48 + tests/layer_manager_row.spec.ts | 70 + tsconfig.webpack.json | 29 + 9 files changed, 5558 insertions(+), 217 deletions(-) create mode 100644 karma.conf.cjs create mode 100644 tests/fake_anywidget.ts create mode 100644 tests/layer_manager.spec.ts create mode 100644 tests/layer_manager_row.spec.ts create mode 100644 tsconfig.webpack.json diff --git a/js/layer_manager_row.ts b/js/layer_manager_row.ts index b9529e4b53..bc2d4dbbca 100644 --- a/js/layer_manager_row.ts +++ b/js/layer_manager_row.ts @@ -42,7 +42,7 @@ export class LayerManagerRow extends LitWidget< text-overflow: ellipsis; } - .settings-delete-button { + .row-button { font-size: 14px; height: 26px; width: 26px; @@ -100,7 +100,7 @@ export class LayerManagerRow extends LitWidget< flex-grow: 1; } - .confirm-deny-button { + .confirm-deletion-container button { height: 26px; width: 70px; } @@ -150,7 +150,7 @@ export class LayerManagerRow extends LitWidget< @input="${this.onLayerOpacityChanged}" />