@gisce/ooui 2.21.0-alpha.2 → 2.21.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gisce/ooui",
3
- "version": "2.21.0-alpha.2",
3
+ "version": "2.21.0-alpha.4",
4
4
  "engines": {
5
5
  "node": "20.5.0"
6
6
  },
package/src/Group.ts CHANGED
@@ -1,6 +1,6 @@
1
- import ContainerWidget from "./ContainerWidget";
1
+ import Spinner from "./Spinner";
2
2
 
3
- class Group extends ContainerWidget {
3
+ class Group extends Spinner {
4
4
  _icon: string | null = null;
5
5
  get icon(): string | null {
6
6
  return this._icon;
package/src/Page.ts CHANGED
@@ -1,6 +1,6 @@
1
- import ContainerWidget from "./ContainerWidget";
1
+ import Spinner from "./Spinner";
2
2
 
3
- class Page extends ContainerWidget {
3
+ class Page extends Spinner {
4
4
  _icon: string | null = null;
5
5
  get icon(): string | null {
6
6
  return this._icon;
@@ -40,4 +40,23 @@ describe("A Group", () => {
40
40
  const widget = widgetFactory.createWidget("group", props);
41
41
  expect(widget.icon).toEqual("home");
42
42
  });
43
+ describe("working as a spinner", () => {
44
+ it("should be loading false as default", () => {
45
+ const widgetFactory = new WidgetFactory();
46
+ const props = {
47
+ string: "A group",
48
+ };
49
+ const widget = widgetFactory.createWidget("group", props);
50
+ expect(widget.loading).toBe(false);
51
+ });
52
+ it("should be loading true if set", () => {
53
+ const widgetFactory = new WidgetFactory();
54
+ const props = {
55
+ string: "A group",
56
+ loading: true,
57
+ };
58
+ const widget = widgetFactory.createWidget("group", props);
59
+ expect(widget.loading).toBe(true);
60
+ });
61
+ });
43
62
  });
@@ -14,4 +14,23 @@ describe("A Page", () => {
14
14
  expect(widget.label).toBe("Page 1");
15
15
  expect(widget.icon).toBe("home");
16
16
  });
17
+ describe("working as a Spinner", () => {
18
+ it("should have loading to be false by default", () => {
19
+ const widgetFactory = new WidgetFactory();
20
+ const props = {
21
+ string: "Page 1",
22
+ };
23
+ const widget = widgetFactory.createWidget("page", props);
24
+ expect(widget.loading).toBe(false);
25
+ });
26
+ it("should allow setting loading to true", () => {
27
+ const widgetFactory = new WidgetFactory();
28
+ const props = {
29
+ string: "Page 1",
30
+ loading: true,
31
+ };
32
+ const widget = widgetFactory.createWidget("page", props);
33
+ expect(widget.loading).toBe(true);
34
+ });
35
+ });
17
36
  });