@kubex/zinc 1.1.61 → 1.1.63

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.
@@ -18,4 +18,33 @@ describe('<zn-toggle>', () => {
18
18
  expect(description.textContent).to.include('Receive an email when mentioned.');
19
19
  expect(label.nextElementSibling).to.equal(description);
20
20
  });
21
+
22
+ describe('form submission', () => {
23
+ it('should submit the value when checked', async () => {
24
+ const form = await fixture<HTMLFormElement>(html`
25
+ <form>
26
+ <zn-toggle name="feature" value="enabled" checked></zn-toggle>
27
+ </form>`);
28
+
29
+ expect(new FormData(form).get('feature')).to.equal('enabled');
30
+ });
31
+
32
+ it('should submit "off" when unchecked', async () => {
33
+ const form = await fixture<HTMLFormElement>(html`
34
+ <form>
35
+ <zn-toggle name="feature" value="enabled"></zn-toggle>
36
+ </form>`);
37
+
38
+ expect(new FormData(form).get('feature')).to.equal('off');
39
+ });
40
+
41
+ it('should submit the fallback value when unchecked', async () => {
42
+ const form = await fixture<HTMLFormElement>(html`
43
+ <form>
44
+ <zn-toggle name="feature" value="enabled" fallback="disabled"></zn-toggle>
45
+ </form>`);
46
+
47
+ expect(new FormData(form).get('feature')).to.equal('disabled');
48
+ });
49
+ });
21
50
  });
@@ -1,4 +1,4 @@
1
- export type ZnErrorEvent = CustomEvent<{ status?: number }>;
1
+ export type ZnErrorEvent = CustomEvent<{ status?: number; message?: string }>;
2
2
 
3
3
  declare global {
4
4
  interface GlobalEventHandlersEventMap {
package/src/zinc.ts CHANGED
@@ -109,6 +109,7 @@ export { default as FlowBranchConditions } from './components/flow-builder/modul
109
109
  export { default as PageBuilder } from './components/page-builder';
110
110
  export { default as PagePaletteItem } from './components/page-builder/modules/page-palette-item';
111
111
  export { default as PageSectionCard } from './components/page-builder/modules/page-section-card';
112
+ export { default as PreviewFrame } from './components/preview-frame';
112
113
  /* plop:component */
113
114
 
114
115
  // Base Component