Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add testing infrastructure for anywidgets, plus test for layer_manager and layer_manager_row #2168

Merged
merged 40 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f2b7037
Implement LayerManager using LitElement + anywidget
naschmitz Oct 10, 2024
8e3ee04
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 10, 2024
acde734
Merge branch 'master' into anywidget
giswqs Oct 10, 2024
919e39a
Update static files
naschmitz Oct 11, 2024
f5af00d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 11, 2024
b87f39d
Use non-minified JS files to work around property renaming issue
naschmitz Oct 14, 2024
6381d46
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 14, 2024
c31d5a9
Set up tests for layer_manager_row
sufyanAbbasi Oct 15, 2024
51a8556
Set up layer_manager_row test
sufyanAbbasi Oct 15, 2024
cdd5040
Implement LayerManager using LitElement + anywidget
naschmitz Oct 10, 2024
bbfa97d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 10, 2024
5fa9733
Update static files
naschmitz Oct 11, 2024
98ef790
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 11, 2024
0729c3d
Use non-minified JS files to work around property renaming issue
naschmitz Oct 14, 2024
b9e0d69
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 14, 2024
7195ac8
Clean up setuptools references in pyproject.toml
naschmitz Oct 14, 2024
ce4c34d
Clean up setuptools references in pyproject.toml
naschmitz Oct 15, 2024
28092e7
Fix dark mode and drop shadow issues in Colab
naschmitz Oct 15, 2024
78e0021
Remove common.css, load fonts using JS instead.
sufyanAbbasi Oct 16, 2024
9d359bc
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 16, 2024
8325c5a
Merge branch 'anywidget' into anywidget-test
sufyanAbbasi Oct 16, 2024
301d254
Rebuild
sufyanAbbasi Oct 16, 2024
0d20641
Remove extraneous files
sufyanAbbasi Oct 16, 2024
84f2661
Address comments from initial review
naschmitz Oct 16, 2024
4a462c0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 16, 2024
befdaa7
Ignore static files
naschmitz Oct 16, 2024
fc9952b
Fix TS errors
sufyanAbbasi Oct 16, 2024
7c1d6fc
Merge branch 'anywidget' into anywidget-test
sufyanAbbasi Oct 16, 2024
243c178
Merge branch 'master' into anywidget
giswqs Oct 17, 2024
25817a7
Convert tsconfig.json to spaces and export model interfaces
naschmitz Oct 18, 2024
cd6c259
Add TS tests for anywidgets
sufyanAbbasi Oct 18, 2024
9dbe4f6
Merge branch 'anywidget' into anywidget-test
sufyanAbbasi Oct 18, 2024
f116e98
Merge remote-tracking branch 'origin/master' into anywidget-test
sufyanAbbasi Nov 11, 2024
b79ea78
clean up styles
sufyanAbbasi Nov 11, 2024
7ae4e23
Add css classes for better testability
sufyanAbbasi Nov 11, 2024
bc8183e
Add better css classes (p2), build before test
sufyanAbbasi Nov 11, 2024
3136832
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 11, 2024
1187c79
Address review comments
sufyanAbbasi Nov 13, 2024
46e83f9
Added a TODO for writing tests for utils.
sufyanAbbasi Nov 13, 2024
f55ffd3
Change single to double quote
sufyanAbbasi Nov 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions js/layer_manager_row.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class LayerManagerRow extends LitWidget<
text-overflow: ellipsis;
}

.settings-delete-button {
.row-button {
font-size: 14px;
height: 26px;
width: 26px;
Expand Down Expand Up @@ -100,7 +100,7 @@ export class LayerManagerRow extends LitWidget<
flex-grow: 1;
}

.confirm-deny-button {
.confirm-deletion-container button {
height: 26px;
width: 70px;
}
Expand Down Expand Up @@ -150,15 +150,16 @@ export class LayerManagerRow extends LitWidget<
@input="${this.onLayerOpacityChanged}"
/>
<button
class="legacy-button settings-delete-button"
class="legacy-button row-button settings-button"
@click="${this.onSettingsClicked}"
>
<span class="material-symbols-outlined">&#xe8b8;</span>
</button>
<button
class=${classMap({
"legacy-button": true,
"settings-delete-button": true,
"row-button": true,
"delete-button": true,
loading: this.isLoading,
"done-loading": !this.isLoading,
})}
Expand All @@ -179,16 +180,16 @@ export class LayerManagerRow extends LitWidget<
return nothing;
}
return html`
<div class="row">
<div class="row confirm-deletion-container">
<span class="legacy-text remove-layer-text">Remove layer?</span>
<button
class="legacy-button primary confirm-deny-button"
class="legacy-button primary confirm-deletion-button"
@click="${this.confirmDeletion}"
>
Yes
</button>
<button
class="legacy-button primary confirm-deny-button"
class="legacy-button primary"
@click="${this.cancelDeletion}"
>
No
Expand Down
2 changes: 2 additions & 0 deletions js/utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// TODO(sufyanAbbasi): Write tests for this file.

import type { AnyModel } from "@anywidget/types";
import { IWidgetManager, WidgetModel } from "@jupyter-widgets/base";

Expand Down
62 changes: 62 additions & 0 deletions karma.conf.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
process.env.CHROME_BIN = require('puppeteer').executablePath();

// test/karma.conf.js
module.exports = config => {
config.set({
frameworks: ['jasmine', 'webpack'],
basePath: '',
type: 'module',
files: [
{pattern: 'js/*.ts', type:'module'},
sufyanAbbasi marked this conversation as resolved.
Show resolved Hide resolved
{pattern: 'tests/*.spec.ts', type:'module'},
],
exclude: [],
client: {
clearContext: false, // leave Jasmine Spec Runner output visible in browser
},
preprocessors: {
'**/*.ts': ['webpack'],
},
webpack: {
mode: 'development',
devtool: 'inline-source-map',
module: {
rules: [
{
test: /\.ts$/,
loader: "ts-loader",
exclude: /node_modules/,
options: {
configFile: "tsconfig.webpack.json"
}
},
],
},
resolve: {
extensions: ['.ts'],
},
stats: {
colors: true,
modules: true,
reasons: true,
errorDetails: true
},
},
reporters: ['spec', 'progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true,
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: ['--no-sandbox'],
},
},
});
};
Loading
Loading