sm-click-library-ui 0.0.604-dev.21 → 0.0.604-dev.22

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.
@@ -4,7 +4,7 @@ import { setActivePinia, createPinia } from "pinia";
4
4
 
5
5
  // Cria um DOM simulado
6
6
  const dom = new JSDOM(`<!DOCTYPE html><html><body></body></html>`, {
7
- url: "http://localhost",
7
+ url: "http://localhost"
8
8
  });
9
9
 
10
10
  // Configura `window` e `document`
@@ -17,33 +17,62 @@ global.window.HTMLElement = dom.window.HTMLElement;
17
17
  global.window.requestAnimationFrame = (cb) => setTimeout(cb, 0);
18
18
  global.window.cancelAnimationFrame = (id) => clearTimeout(id);
19
19
 
20
+ // `vue3-emoji-picker` abre um IndexedDB já no import e jsdom não implementa IndexedDB:
21
+ // sem estes stubs todo teste que importa a lib termina com uma unhandled rejection.
22
+ // A request nunca dispara evento — o open fica pendente e o banco não existe no teste.
23
+ if (!global.indexedDB) {
24
+ global.IDBRequest = class IDBRequest {
25
+ addEventListener() {}
26
+ removeEventListener() {}
27
+ };
28
+ global.IDBTransaction = class IDBTransaction {};
29
+ global.IDBDatabase = class IDBDatabase {};
30
+ global.IDBObjectStore = class IDBObjectStore {};
31
+ global.IDBIndex = class IDBIndex {};
32
+ global.IDBCursor = class IDBCursor {};
33
+ global.indexedDB = {
34
+ open: () => new global.IDBRequest(),
35
+ deleteDatabase: () => new global.IDBRequest()
36
+ };
37
+ }
38
+
39
+ // jsdom não implementa IntersectionObserver e o `v3-infinite-loading` instancia um
40
+ // no mount — sem stub a paginação infinita derruba o teste com unhandled rejection.
41
+ global.IntersectionObserver = vi.fn().mockImplementation(() => ({
42
+ observe: vi.fn(),
43
+ unobserve: vi.fn(),
44
+ disconnect: vi.fn(),
45
+ takeRecords: vi.fn(() => [])
46
+ }));
47
+ global.window.IntersectionObserver = global.IntersectionObserver;
48
+
20
49
  global.ResizeObserver = vi.fn().mockImplementation(() => ({
21
- observe: vi.fn(),
22
- unobserve: vi.fn(),
23
- disconnect: vi.fn(),
50
+ observe: vi.fn(),
51
+ unobserve: vi.fn(),
52
+ disconnect: vi.fn()
24
53
  }));
25
54
 
26
55
  global.window.matchMedia = vi.fn().mockImplementation(() => ({
27
- matches: false,
28
- addListener: vi.fn(),
29
- removeListener: vi.fn(),
56
+ matches: false,
57
+ addListener: vi.fn(),
58
+ removeListener: vi.fn()
30
59
  }));
31
60
 
32
61
  // Configuração global do Vue Test Utils
33
62
  config.global.stubs = {
34
- Popper: true, // Evita erro de componente não encontrado
35
- VueAwesomePaginate: true, // Stub para VueAwesomePaginate
36
- SimpleModal: true, // Stub para SimpleModal
37
- datepicker: true, // Stub para datepicker,
38
- Svg: { template: "<svg></svg>" },
39
- Popper: { template: "<div><slot /></div>" },
40
- putVideo: { template: "<div></div>" },
41
- VueAwesomePaginate: { template: "<div></div>" },
42
- SimpleLoader: { template: "<div></div>" },
63
+ Popper: true, // Evita erro de componente não encontrado
64
+ VueAwesomePaginate: true, // Stub para VueAwesomePaginate
65
+ SimpleModal: true, // Stub para SimpleModal
66
+ datepicker: true, // Stub para datepicker,
67
+ Svg: { template: "<svg></svg>" },
68
+ Popper: { template: "<div><slot /></div>" },
69
+ putVideo: { template: "<div></div>" },
70
+ VueAwesomePaginate: { template: "<div></div>" },
71
+ SimpleLoader: { template: "<div></div>" }
43
72
  };
44
73
 
45
74
  config.global.directives = {
46
- lazy: () => {},
75
+ lazy: () => {}
47
76
  };
48
77
 
49
78
  // Ativando Pinia para os testes
@@ -53,14 +82,14 @@ setActivePinia(createPinia()); // Certifica que Pinia está disponível nos test
53
82
  import { vi } from "vitest";
54
83
 
55
84
  vi.mock("@/router/axios", () => ({
56
- default: {
57
- get: vi.fn().mockResolvedValue({ data: [] }), // Return an empty array (or any default data)
58
- post: vi.fn(),
59
- delete: vi.fn(),
60
- patch: vi.fn(),
61
- },
85
+ default: {
86
+ get: vi.fn().mockResolvedValue({ data: [] }), // Return an empty array (or any default data)
87
+ post: vi.fn(),
88
+ delete: vi.fn(),
89
+ patch: vi.fn()
90
+ }
62
91
  }));
63
92
  // Mock de notiwind para evitar notificações em testes
64
93
  vi.mock("notiwind", () => ({
65
- notify: vi.fn(),
94
+ notify: vi.fn()
66
95
  }));
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, ref, watchEffect, computed, watch, createElementBlock, openBlock, normalizeStyle } from "vue";
2
- import { c as commonjsGlobal, g as getDefaultExportFromCjs } from "./index-Bpy8sVRd.js";
2
+ import { c as commonjsGlobal, g as getDefaultExportFromCjs } from "./index-Dycm1luc.js";
3
3
  var lottie = { exports: {} };
4
4
  (function(module, exports) {
5
5
  typeof navigator < "u" && function(t, e) {
@@ -1,4 +1,4 @@
1
- import { r as le, C as ge, g as me, W as we } from "./index-Bpy8sVRd.js";
1
+ import { r as le, C as ge, g as me, W as we } from "./index-Dycm1luc.js";
2
2
  const F = {
3
3
  RECORDING: "RECORDING",
4
4
  PAUSED: "PAUSED",
@@ -58,7 +58,7 @@ var te;
58
58
  n.UTF8 = "utf8", n.ASCII = "ascii", n.UTF16 = "utf16";
59
59
  })(te || (te = {}));
60
60
  const k = le("Filesystem", {
61
- web: () => import("./web-Dr-FIxVc.js").then((n) => new n.FilesystemWeb())
61
+ web: () => import("./web-O2erAMb3.js").then((n) => new n.FilesystemWeb())
62
62
  });
63
63
  Ee();
64
64
  const _e = le("BlobWriter");
@@ -1,5 +1,5 @@
1
- import { W as P, b as x } from "./index-Bpy8sVRd.js";
2
- import { E } from "./web-T9BWrvle.js";
1
+ import { W as P, b as x } from "./index-Dycm1luc.js";
2
+ import { E } from "./web-BOc26YUc.js";
3
3
  function m(w) {
4
4
  const e = w.split("/").filter((t) => t !== "."), r = [];
5
5
  return e.forEach((t) => {
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "dist",
6
6
  "src/test-utils"
7
7
  ],
8
- "version": "0.0.604-dev.21",
8
+ "version": "0.0.604-dev.22",
9
9
  "main": "dist/sm-click-library-ui.es.js",
10
10
  "module": "dist/sm-click-library-ui.umd.js",
11
11
  "style": "dist/style.css",
@@ -4,7 +4,7 @@ import { setActivePinia, createPinia } from "pinia";
4
4
 
5
5
  // Cria um DOM simulado
6
6
  const dom = new JSDOM(`<!DOCTYPE html><html><body></body></html>`, {
7
- url: "http://localhost",
7
+ url: "http://localhost"
8
8
  });
9
9
 
10
10
  // Configura `window` e `document`
@@ -17,33 +17,62 @@ global.window.HTMLElement = dom.window.HTMLElement;
17
17
  global.window.requestAnimationFrame = (cb) => setTimeout(cb, 0);
18
18
  global.window.cancelAnimationFrame = (id) => clearTimeout(id);
19
19
 
20
+ // `vue3-emoji-picker` abre um IndexedDB já no import e jsdom não implementa IndexedDB:
21
+ // sem estes stubs todo teste que importa a lib termina com uma unhandled rejection.
22
+ // A request nunca dispara evento — o open fica pendente e o banco não existe no teste.
23
+ if (!global.indexedDB) {
24
+ global.IDBRequest = class IDBRequest {
25
+ addEventListener() {}
26
+ removeEventListener() {}
27
+ };
28
+ global.IDBTransaction = class IDBTransaction {};
29
+ global.IDBDatabase = class IDBDatabase {};
30
+ global.IDBObjectStore = class IDBObjectStore {};
31
+ global.IDBIndex = class IDBIndex {};
32
+ global.IDBCursor = class IDBCursor {};
33
+ global.indexedDB = {
34
+ open: () => new global.IDBRequest(),
35
+ deleteDatabase: () => new global.IDBRequest()
36
+ };
37
+ }
38
+
39
+ // jsdom não implementa IntersectionObserver e o `v3-infinite-loading` instancia um
40
+ // no mount — sem stub a paginação infinita derruba o teste com unhandled rejection.
41
+ global.IntersectionObserver = vi.fn().mockImplementation(() => ({
42
+ observe: vi.fn(),
43
+ unobserve: vi.fn(),
44
+ disconnect: vi.fn(),
45
+ takeRecords: vi.fn(() => [])
46
+ }));
47
+ global.window.IntersectionObserver = global.IntersectionObserver;
48
+
20
49
  global.ResizeObserver = vi.fn().mockImplementation(() => ({
21
- observe: vi.fn(),
22
- unobserve: vi.fn(),
23
- disconnect: vi.fn(),
50
+ observe: vi.fn(),
51
+ unobserve: vi.fn(),
52
+ disconnect: vi.fn()
24
53
  }));
25
54
 
26
55
  global.window.matchMedia = vi.fn().mockImplementation(() => ({
27
- matches: false,
28
- addListener: vi.fn(),
29
- removeListener: vi.fn(),
56
+ matches: false,
57
+ addListener: vi.fn(),
58
+ removeListener: vi.fn()
30
59
  }));
31
60
 
32
61
  // Configuração global do Vue Test Utils
33
62
  config.global.stubs = {
34
- Popper: true, // Evita erro de componente não encontrado
35
- VueAwesomePaginate: true, // Stub para VueAwesomePaginate
36
- SimpleModal: true, // Stub para SimpleModal
37
- datepicker: true, // Stub para datepicker,
38
- Svg: { template: "<svg></svg>" },
39
- Popper: { template: "<div><slot /></div>" },
40
- putVideo: { template: "<div></div>" },
41
- VueAwesomePaginate: { template: "<div></div>" },
42
- SimpleLoader: { template: "<div></div>" },
63
+ Popper: true, // Evita erro de componente não encontrado
64
+ VueAwesomePaginate: true, // Stub para VueAwesomePaginate
65
+ SimpleModal: true, // Stub para SimpleModal
66
+ datepicker: true, // Stub para datepicker,
67
+ Svg: { template: "<svg></svg>" },
68
+ Popper: { template: "<div><slot /></div>" },
69
+ putVideo: { template: "<div></div>" },
70
+ VueAwesomePaginate: { template: "<div></div>" },
71
+ SimpleLoader: { template: "<div></div>" }
43
72
  };
44
73
 
45
74
  config.global.directives = {
46
- lazy: () => {},
75
+ lazy: () => {}
47
76
  };
48
77
 
49
78
  // Ativando Pinia para os testes
@@ -53,14 +82,14 @@ setActivePinia(createPinia()); // Certifica que Pinia está disponível nos test
53
82
  import { vi } from "vitest";
54
83
 
55
84
  vi.mock("@/router/axios", () => ({
56
- default: {
57
- get: vi.fn().mockResolvedValue({ data: [] }), // Return an empty array (or any default data)
58
- post: vi.fn(),
59
- delete: vi.fn(),
60
- patch: vi.fn(),
61
- },
85
+ default: {
86
+ get: vi.fn().mockResolvedValue({ data: [] }), // Return an empty array (or any default data)
87
+ post: vi.fn(),
88
+ delete: vi.fn(),
89
+ patch: vi.fn()
90
+ }
62
91
  }));
63
92
  // Mock de notiwind para evitar notificações em testes
64
93
  vi.mock("notiwind", () => ({
65
- notify: vi.fn(),
94
+ notify: vi.fn()
66
95
  }));