Get tests for Button passing again

This commit is contained in:
nathan 2023-01-04 15:03:43 -07:00
parent 40278c8827
commit acd44a1e0e
4 changed files with 8 additions and 4 deletions

View File

@ -145,7 +145,7 @@ export const ButtonMixin = <T extends Constructor>(superclass : T) => class exte
{ {
return { return {
...super.properties, ...super.properties,
image: {type: String}, image: {type: String, noAccessor: true},
/** /**
* If button is set to readonly, do we want to hide it completely (old behaviour) or show it as disabled * If button is set to readonly, do we want to hide it completely (old behaviour) or show it as disabled

View File

@ -12,6 +12,8 @@
import {Et2InputWidget} from "../Et2InputWidget/Et2InputWidget"; import {Et2InputWidget} from "../Et2InputWidget/Et2InputWidget";
import '../Et2Image/Et2Image'; import '../Et2Image/Et2Image';
import {SlButton} from "@shoelace-style/shoelace"; import {SlButton} from "@shoelace-style/shoelace";
import {ButtonMixin} from "./ButtonMixin";
import {PropertyValues} from "@lion/core";
export class Et2Button extends ButtonMixin(Et2InputWidget(SlButton)) export class Et2Button extends ButtonMixin(Et2InputWidget(SlButton))

View File

@ -55,12 +55,14 @@ describe("Button widget", () =>
it("gets an icon", async() => it("gets an icon", async() =>
{ {
// Wait for the render to finish
await element.updateComplete;
element.image = "check"; element.image = "check";
// Wait for the render to finish // Wait for the render to finish
await element.updateComplete; await element.updateComplete;
let image = element.querySelectorAll("et2-image");
let image = element.querySelectorAll("img");
assert.equal(image.length, 1); assert.equal(image.length, 1);
assert.equal(image[0].src, element.egw().image("check")); assert.equal(image[0].src, element.egw().image("check"));
}) })

View File

@ -46,7 +46,7 @@ export default {
[ [
{ {
name: 'api', name: 'api',
files: 'api/js/etemplate/**/test/*.test.js' files: 'api/js/etemplate/**/test/*.test.ts'
} }
].concat( ].concat(
appJS.map(app => appJS.map(app =>