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.
- package/dist/{index-Bpy8sVRd.js → index-Dycm1luc.js} +7 -7
- package/dist/sm-click-library-ui.es.js +1 -1
- package/dist/sm-click-library-ui.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/test-utils/setup.js +53 -24
- package/dist/{vue3-lottie.es-DNLXLLeo.js → vue3-lottie.es-DUE9TYOT.js} +1 -1
- package/dist/{web-T9BWrvle.js → web-BOc26YUc.js} +2 -2
- package/dist/{web-Dr-FIxVc.js → web-O2erAMb3.js} +2 -2
- package/package.json +1 -1
- package/src/test-utils/setup.js +53 -24
package/dist/test-utils/setup.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
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
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
2
|
-
import { E } from "./web-
|
|
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
package/src/test-utils/setup.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
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
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
-
|
|
94
|
+
notify: vi.fn()
|
|
66
95
|
}));
|