@1doc/1ds-vue 2.9.0 → 2.10.0
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/CHANGELOG.md +434 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +119 -8
- package/dist/index.mjs +9512 -8153
- package/dist/index.umd.js +4 -4
- package/package.json +3 -3
- package/src/teste/accordion-titulo-neutro.test.mjs +32 -0
- package/src/teste/appsubheader-regiao.test.mjs +18 -0
- package/src/teste/attachmentcard-lista.test.mjs +39 -0
- package/src/teste/attachmentcard-sm.test.mjs +28 -0
- package/src/teste/badge-neutro-colado.test.mjs +30 -0
- package/src/teste/badge-tag.test.mjs +8 -0
- package/src/teste/calendar-slots-cabecalho.test.mjs +46 -0
- package/src/teste/coachmark-sem-veu.test.mjs +70 -0
- package/src/teste/color-picker-xs.test.mjs +28 -0
- package/src/teste/datatable-arvore-variantes.test.mjs +194 -0
- package/src/teste/descriptionlist-compacta.test.mjs +32 -0
- package/src/teste/dom.mjs +2 -0
- package/src/teste/empty-state-titulo-rico.test.mjs +39 -0
- package/src/teste/input-agrupado.test.mjs +44 -0
- package/src/teste/list-item-standalone.test.mjs +75 -0
- package/src/teste/list.test.mjs +2 -1
- package/src/teste/rich-text-editor-alinha-imagem-tabela.test.mjs +164 -0
- package/src/teste/rich-text-editor-estilo-de-texto.test.mjs +87 -0
- package/src/teste/segmented-contador.test.mjs +39 -0
- package/src/teste/select-aberto-controlado-flutuante.test.mjs +120 -0
- package/src/teste/select-filtro-cor-tamanho.test.mjs +62 -0
- package/src/teste/statcard-secundaria-tom.test.mjs +41 -0
- package/src/teste/toast-acao-detalhes.test.mjs +48 -0
- package/src/utils/html-seguro.ts +105 -2
- package/src/utils/toast.ts +12 -2
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ListItem no Vue: tooltip, standalone e atributos só no elemento interativo (DOM do jsdom).
|
|
3
|
+
*/
|
|
4
|
+
import { test, after } from "node:test";
|
|
5
|
+
import assert from "node:assert/strict";
|
|
6
|
+
import { montar, clicar } from "./dom.mjs";
|
|
7
|
+
|
|
8
|
+
const montados = [];
|
|
9
|
+
const abrir = async (props, slots) => {
|
|
10
|
+
const m = await montar("List/ListItem.vue", props, slots);
|
|
11
|
+
montados.push(m);
|
|
12
|
+
return m;
|
|
13
|
+
};
|
|
14
|
+
after(() => montados.forEach((m) => m.desmontar()));
|
|
15
|
+
|
|
16
|
+
test("aria-*, role, data-* e style vão só ao elemento interativo; o li fica limpo", async () => {
|
|
17
|
+
const m = await abrir({
|
|
18
|
+
title: "Memorando 114/2025",
|
|
19
|
+
tooltip: "Abrir o memorando",
|
|
20
|
+
"aria-label": "Memorando",
|
|
21
|
+
role: "menuitem",
|
|
22
|
+
"data-origem": "home",
|
|
23
|
+
style: "margin-top: 4px",
|
|
24
|
+
});
|
|
25
|
+
const li = m.raiz.querySelector("li");
|
|
26
|
+
const botao = li.querySelector("button");
|
|
27
|
+
assert.equal(botao.getAttribute("title"), "Abrir o memorando");
|
|
28
|
+
assert.equal(botao.getAttribute("aria-label"), "Memorando");
|
|
29
|
+
assert.equal(botao.getAttribute("role"), "menuitem");
|
|
30
|
+
assert.equal(botao.getAttribute("data-origem"), "home");
|
|
31
|
+
assert.match(botao.getAttribute("style"), /margin-top:\s*4px/);
|
|
32
|
+
for (const a of ["title", "aria-label", "role", "data-origem", "style"]) {
|
|
33
|
+
assert.equal(li.getAttribute(a), null, `li não deve ter ${a}`);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test("o class do Vue segue no li, como sempre", async () => {
|
|
38
|
+
const m = await abrir({ title: "Com classe", class: "minha-linha" });
|
|
39
|
+
assert.ok(m.raiz.querySelector("li").classList.contains("minha-linha"));
|
|
40
|
+
assert.ok(!m.raiz.querySelector("button").classList.contains("minha-linha"));
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test("tooltip no link e na linha div; sem tooltip não há title", async () => {
|
|
44
|
+
const link = await abrir({ title: "Link", href: "/x", tooltip: "Dica do link" });
|
|
45
|
+
assert.equal(link.raiz.querySelector("a").getAttribute("title"), "Dica do link");
|
|
46
|
+
const div = await abrir({ title: "Div", as: "div", tooltip: "Dica da div" });
|
|
47
|
+
assert.equal(div.raiz.querySelector(".umds-list-item").getAttribute("title"), "Dica da div");
|
|
48
|
+
const sem = await abrir({ title: "Sem dica" });
|
|
49
|
+
assert.equal(sem.raiz.querySelector("[title]"), null);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
test("standalone: sem li, só o elemento interativo, com class, aria e clique", async () => {
|
|
53
|
+
let cliques = 0;
|
|
54
|
+
const m = await abrir({
|
|
55
|
+
standalone: true,
|
|
56
|
+
title: "12",
|
|
57
|
+
tooltip: "Página 12",
|
|
58
|
+
class: "numero",
|
|
59
|
+
"aria-label": "Página 12",
|
|
60
|
+
onClick: () => cliques++,
|
|
61
|
+
});
|
|
62
|
+
assert.equal(m.raiz.querySelector("li"), null);
|
|
63
|
+
const botao = m.raiz.querySelector("button");
|
|
64
|
+
assert.ok(botao);
|
|
65
|
+
assert.ok(botao.classList.contains("numero"));
|
|
66
|
+
assert.equal(botao.getAttribute("aria-label"), "Página 12");
|
|
67
|
+
assert.equal(botao.getAttribute("title"), "Página 12");
|
|
68
|
+
await clicar(botao);
|
|
69
|
+
assert.equal(cliques, 1);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
test("sem standalone o li continua lá", async () => {
|
|
73
|
+
const m = await abrir({ title: "Normal" });
|
|
74
|
+
assert.equal(m.raiz.querySelectorAll("li").length, 1);
|
|
75
|
+
});
|
package/src/teste/list.test.mjs
CHANGED
|
@@ -22,7 +22,8 @@ after(fechar);
|
|
|
22
22
|
|
|
23
23
|
test("ListItem sem as nem href é um button dentro de um li", async () => {
|
|
24
24
|
const html = await renderizar(ListItem, { title: "Memorando 114/2025" });
|
|
25
|
-
|
|
25
|
+
// o ListItem tem duas raízes (com li e standalone): o HTML abre com marcador de fragmento
|
|
26
|
+
assert.match(html, new RegExp(`${ABRE}<li class="umds-list__item"><button type="button"`));
|
|
26
27
|
assert.match(html, /Memorando 114\/2025/);
|
|
27
28
|
assert.doesNotMatch(html, /<a[ >]/);
|
|
28
29
|
});
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RichTextEditor no Vue: alinhamento, imagem e tabela (DOM do jsdom). O jsdom não
|
|
3
|
+
* traz `execCommand`: o teste usa um espião e confere o que o editor pede.
|
|
4
|
+
*/
|
|
5
|
+
import { test, after, beforeEach } from "node:test";
|
|
6
|
+
import assert from "node:assert/strict";
|
|
7
|
+
import { montar, documento, janela, clicar, digitar, proximoTick } from "./dom.mjs";
|
|
8
|
+
|
|
9
|
+
let chamadas;
|
|
10
|
+
let estados;
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
chamadas = [];
|
|
13
|
+
estados = {};
|
|
14
|
+
documento.execCommand = (...args) => {
|
|
15
|
+
chamadas.push(args);
|
|
16
|
+
return true;
|
|
17
|
+
};
|
|
18
|
+
documento.queryCommandState = (c) => !!estados[c];
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const montados = [];
|
|
22
|
+
const abrir = async (props = {}) => {
|
|
23
|
+
const m = await montar("RichTextEditor/RichTextEditor.vue", { ariaLabel: "Despacho", ...props });
|
|
24
|
+
montados.push(m);
|
|
25
|
+
await proximoTick();
|
|
26
|
+
return m;
|
|
27
|
+
};
|
|
28
|
+
after(() => montados.forEach((m) => m.desmontar()));
|
|
29
|
+
|
|
30
|
+
const area = (m) => m.raiz.querySelector('[role="textbox"]');
|
|
31
|
+
const botao = (m, nome) => [...m.raiz.querySelectorAll("button")].find((b) => b.getAttribute("aria-label") === nome || b.textContent.trim() === nome);
|
|
32
|
+
const campo = (m, rotulo) => {
|
|
33
|
+
const label = [...m.raiz.querySelectorAll("label")].find((l) => l.textContent.trim().startsWith(rotulo));
|
|
34
|
+
return label ? m.raiz.querySelector(`#${label.getAttribute("for")}`) : null;
|
|
35
|
+
};
|
|
36
|
+
const PNG = "data:image/png;base64,iVBORw0KGgo=";
|
|
37
|
+
|
|
38
|
+
test("as quatro ferramentas de alinhamento pedem o comando e seguem o cursor", async () => {
|
|
39
|
+
const m = await abrir({ toolbar: ["alignLeft", "alignCenter", "alignRight", "alignJustify"], defaultValue: "<p>x</p>" });
|
|
40
|
+
const esperado = {
|
|
41
|
+
"Alinhar à esquerda": "justifyLeft",
|
|
42
|
+
Centralizar: "justifyCenter",
|
|
43
|
+
"Alinhar à direita": "justifyRight",
|
|
44
|
+
Justificar: "justifyFull",
|
|
45
|
+
};
|
|
46
|
+
for (const [nome, comando] of Object.entries(esperado)) {
|
|
47
|
+
chamadas.length = 0;
|
|
48
|
+
await clicar(botao(m, nome));
|
|
49
|
+
assert.deepEqual(chamadas[0], [comando, false, undefined], nome);
|
|
50
|
+
}
|
|
51
|
+
estados.justifyCenter = true;
|
|
52
|
+
const faixa = documento.createRange();
|
|
53
|
+
faixa.selectNodeContents(area(m));
|
|
54
|
+
janela.getSelection().removeAllRanges();
|
|
55
|
+
janela.getSelection().addRange(faixa);
|
|
56
|
+
documento.dispatchEvent(new janela.Event("selectionchange"));
|
|
57
|
+
await proximoTick();
|
|
58
|
+
assert.equal(botao(m, "Centralizar").getAttribute("aria-pressed"), "true");
|
|
59
|
+
assert.equal(botao(m, "Justificar").getAttribute("aria-pressed"), "false");
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test("a barra padrão não ganha as ferramentas novas", async () => {
|
|
63
|
+
const m = await abrir();
|
|
64
|
+
for (const nome of ["Centralizar", "Imagem", "Tabela"]) assert.equal(botao(m, nome), undefined, nome);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
test("o valor com text-align, imagem e tabela passa pela higienização", async () => {
|
|
68
|
+
const m = await abrir({
|
|
69
|
+
defaultValue: `<p style="text-align: center; color: red">a</p><img src="${PNG}" alt="x" onerror="y()"><img src="javascript:alert(1)"><table><tbody><tr><td colspan="2">c</td></tr></tbody></table>`,
|
|
70
|
+
});
|
|
71
|
+
const html = area(m).innerHTML;
|
|
72
|
+
assert.ok(html.includes('<p style="text-align: center;">a</p>'));
|
|
73
|
+
assert.ok(html.includes(`<img src="${PNG}" alt="x">`));
|
|
74
|
+
assert.doesNotMatch(html, /javascript|onerror|color/);
|
|
75
|
+
assert.ok(html.includes('<td colspan="2">c</td>'));
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
test("imagem: o painel abre, o endereço vira img com alt, o perigoso dá erro", async () => {
|
|
79
|
+
const vistos = [];
|
|
80
|
+
const m = await abrir({ toolbar: ["image"], defaultValue: "<p>t</p>", onChange: (h) => vistos.push(h) });
|
|
81
|
+
await clicar(botao(m, "Imagem"));
|
|
82
|
+
const url = campo(m, "Endereço da imagem");
|
|
83
|
+
assert.ok(url, "campo do endereço");
|
|
84
|
+
await digitar(url, "javascript:alert(1)");
|
|
85
|
+
await clicar(botao(m, "Inserir imagem"));
|
|
86
|
+
assert.match(m.raiz.textContent, /Use um endereço http ou https/);
|
|
87
|
+
assert.equal(chamadas.length, 0);
|
|
88
|
+
|
|
89
|
+
await digitar(campo(m, "Endereço da imagem"), "exemplo.com.br/brasao.png");
|
|
90
|
+
await digitar(campo(m, "Texto alternativo"), "Brasão");
|
|
91
|
+
await clicar(botao(m, "Inserir imagem"));
|
|
92
|
+
assert.deepEqual(chamadas.at(-1), ["insertHTML", false, '<img src="https://exemplo.com.br/brasao.png" alt="Brasão">']);
|
|
93
|
+
assert.equal(campo(m, "Endereço da imagem"), null, "o painel fecha");
|
|
94
|
+
assert.ok(vistos.length > 0);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
test("imagem: arquivo vira data URL; tipo e tamanho inválidos são recusados", async () => {
|
|
98
|
+
const m = await abrir({ toolbar: ["image"] });
|
|
99
|
+
await clicar(botao(m, "Imagem"));
|
|
100
|
+
const entrada = m.raiz.querySelector('input[type="file"]');
|
|
101
|
+
const mandar = async (arquivo) => {
|
|
102
|
+
Object.defineProperty(entrada, "files", { value: [arquivo], configurable: true });
|
|
103
|
+
entrada.dispatchEvent(new janela.Event("change", { bubbles: true }));
|
|
104
|
+
await new Promise((r) => setTimeout(r, 50));
|
|
105
|
+
await proximoTick();
|
|
106
|
+
};
|
|
107
|
+
await mandar(new janela.File(["x"], "a.svg", { type: "image/svg+xml" }));
|
|
108
|
+
assert.match(m.raiz.textContent, /Use uma imagem PNG, JPEG, GIF ou WebP/);
|
|
109
|
+
const grande = new janela.File(["x"], "g.png", { type: "image/png" });
|
|
110
|
+
Object.defineProperty(grande, "size", { value: 3 * 1024 * 1024 });
|
|
111
|
+
await mandar(grande);
|
|
112
|
+
assert.match(m.raiz.textContent, /A imagem passa de 2 MB/);
|
|
113
|
+
await mandar(new janela.File([new Uint8Array([137, 80, 78, 71])], "brasao.png", { type: "image/png" }));
|
|
114
|
+
assert.match(m.raiz.textContent, /brasao\.png/);
|
|
115
|
+
await clicar(botao(m, "Inserir imagem"));
|
|
116
|
+
assert.match(chamadas.at(-1)[2], /^<img src="data:image\/png;base64,[A-Za-z0-9+/=]+" alt="">$/);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
test("tabela: o painel insere linhas × colunas; fora do limite dá erro", async () => {
|
|
120
|
+
const m = await abrir({ toolbar: ["table"] });
|
|
121
|
+
await clicar(botao(m, "Tabela"));
|
|
122
|
+
await digitar(campo(m, "Colunas"), "11");
|
|
123
|
+
await clicar(botao(m, "Inserir tabela"));
|
|
124
|
+
assert.match(m.raiz.textContent, /Use de 1 a 20 linhas e de 1 a 10 colunas/);
|
|
125
|
+
assert.equal(chamadas.length, 0);
|
|
126
|
+
await digitar(campo(m, "Colunas"), "2");
|
|
127
|
+
await digitar(campo(m, "Linhas"), "4");
|
|
128
|
+
await clicar(botao(m, "Inserir tabela"));
|
|
129
|
+
const html = chamadas.at(-1)[2];
|
|
130
|
+
assert.equal((html.match(/<tr>/g) || []).length, 4);
|
|
131
|
+
assert.equal((html.match(/<td><br><\/td>/g) || []).length, 8);
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
test("tabela: com o cursor numa célula a barra adiciona e remove linha e coluna", async () => {
|
|
135
|
+
const m = await abrir({
|
|
136
|
+
toolbar: ["table"],
|
|
137
|
+
defaultValue: "<table><tbody><tr><td>a</td><td>b</td></tr><tr><td>c</td><td>d</td></tr></tbody></table>",
|
|
138
|
+
});
|
|
139
|
+
const cursor = async (i) => {
|
|
140
|
+
const faixa = documento.createRange();
|
|
141
|
+
faixa.selectNodeContents(area(m).querySelectorAll("td")[i]);
|
|
142
|
+
janela.getSelection().removeAllRanges();
|
|
143
|
+
janela.getSelection().addRange(faixa);
|
|
144
|
+
documento.dispatchEvent(new janela.Event("selectionchange"));
|
|
145
|
+
await proximoTick();
|
|
146
|
+
};
|
|
147
|
+
assert.equal(m.raiz.querySelector('[role="group"]'), null);
|
|
148
|
+
await cursor(0);
|
|
149
|
+
assert.ok(m.raiz.querySelector('[role="group"]'), "a barra aparece");
|
|
150
|
+
await clicar(botao(m, "Adicionar coluna"));
|
|
151
|
+
assert.equal(area(m).querySelectorAll("tr")[0].cells.length, 3);
|
|
152
|
+
await cursor(0);
|
|
153
|
+
await clicar(botao(m, "Adicionar linha"));
|
|
154
|
+
assert.equal(area(m).querySelectorAll("tr").length, 3);
|
|
155
|
+
await cursor(0);
|
|
156
|
+
await clicar(botao(m, "Remover linha"));
|
|
157
|
+
assert.equal(area(m).querySelectorAll("tr").length, 2);
|
|
158
|
+
await cursor(0);
|
|
159
|
+
await clicar(botao(m, "Remover coluna"));
|
|
160
|
+
assert.equal(area(m).querySelectorAll("tr")[0].cells.length, 2);
|
|
161
|
+
await cursor(0);
|
|
162
|
+
await clicar(botao(m, "Remover tabela"));
|
|
163
|
+
assert.equal(area(m).querySelector("table"), null);
|
|
164
|
+
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/** RichTextEditor: fonte, tamanho e cor do texto por token, no Vue (DOM do jsdom). */
|
|
2
|
+
import { test, after, beforeEach } from "node:test";
|
|
3
|
+
import assert from "node:assert/strict";
|
|
4
|
+
import { montar, documento, janela, clicar, proximoTick } from "./dom.mjs";
|
|
5
|
+
|
|
6
|
+
let chamadas;
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
chamadas = [];
|
|
9
|
+
documento.execCommand = (...args) => {
|
|
10
|
+
chamadas.push(args);
|
|
11
|
+
return true;
|
|
12
|
+
};
|
|
13
|
+
documento.queryCommandState = () => false;
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const montados = [];
|
|
17
|
+
const abrir = async (props = {}) => {
|
|
18
|
+
const m = await montar("RichTextEditor/RichTextEditor.vue", { ariaLabel: "Despacho", defaultValue: "<p>Parecer</p>", ...props });
|
|
19
|
+
montados.push(m);
|
|
20
|
+
await proximoTick();
|
|
21
|
+
return m;
|
|
22
|
+
};
|
|
23
|
+
after(() => montados.forEach((m) => m.desmontar()));
|
|
24
|
+
|
|
25
|
+
const area = (m) => m.raiz.querySelector('[role="textbox"]');
|
|
26
|
+
const botao = (m, nome) => [...m.raiz.querySelectorAll("button")].find((b) => b.getAttribute("aria-label") === nome || b.textContent.trim() === nome);
|
|
27
|
+
const selecionar = (m) => {
|
|
28
|
+
const texto = area(m).querySelector("p").firstChild;
|
|
29
|
+
const faixa = documento.createRange();
|
|
30
|
+
faixa.setStart(texto, 0);
|
|
31
|
+
faixa.setEnd(texto, texto.length);
|
|
32
|
+
janela.getSelection().removeAllRanges();
|
|
33
|
+
janela.getSelection().addRange(faixa);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
test("a barra padrão não ganha as ferramentas novas", async () => {
|
|
37
|
+
const m = await abrir();
|
|
38
|
+
for (const nome of ["Fonte", "Tamanho da fonte", "Cor do texto"]) assert.equal(botao(m, nome), undefined, nome);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test("o valor volta higienizado: só token do DS passa no style do span", async () => {
|
|
42
|
+
const m = await abrir({ defaultValue: '<p><span style="color: var(--umds-primitive-blue-pure); background: red; font-size: 40px">a</span><b style="color: var(--umds-primitive-red-pure)">b</b></p>' });
|
|
43
|
+
assert.equal(area(m).innerHTML, '<p><span style="color: var(--umds-primitive-blue-pure);">a</span><b>b</b></p>');
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test("cada ferramenta abre um painel nomeado; Fechar fecha", async () => {
|
|
47
|
+
const m = await abrir({ toolbar: ["fontFamily", "fontSize", "textColor"] });
|
|
48
|
+
await clicar(botao(m, "Tamanho da fonte"));
|
|
49
|
+
assert.equal(m.raiz.querySelector('[role="group"]').getAttribute("aria-label"), "Tamanho da fonte");
|
|
50
|
+
await clicar(botao(m, "Fechar"));
|
|
51
|
+
assert.equal(m.raiz.querySelector('[role="group"]'), null);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
test("a fonte monoespaçada embrulha o texto selecionado num span com o token", async () => {
|
|
55
|
+
const m = await abrir({ toolbar: ["fontFamily"] });
|
|
56
|
+
selecionar(m);
|
|
57
|
+
await clicar(botao(m, "Fonte"));
|
|
58
|
+
await clicar(m.raiz.querySelector('[role="combobox"]'));
|
|
59
|
+
const mono = [...m.raiz.querySelectorAll('[role="option"]')].find((o) => o.textContent.includes("Monoespaçada"));
|
|
60
|
+
await clicar(mono);
|
|
61
|
+
assert.deepEqual(chamadas.at(-1), ["insertHTML", false, '<span style="font-family: var(--umds-semantic-font-family-mono);">Parecer</span>']);
|
|
62
|
+
assert.equal(m.raiz.querySelector('[role="group"]'), null, "o painel fecha");
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
test("o tamanho usa os degraus 12, 14, 16, 20 e 24", async () => {
|
|
66
|
+
const m = await abrir({ toolbar: ["fontSize"] });
|
|
67
|
+
selecionar(m);
|
|
68
|
+
await clicar(botao(m, "Tamanho da fonte"));
|
|
69
|
+
await clicar(m.raiz.querySelector('[role="combobox"]'));
|
|
70
|
+
const opcoes = [...m.raiz.querySelectorAll('[role="option"]')];
|
|
71
|
+
assert.deepEqual(opcoes.map((o) => o.textContent.trim()), ["12", "14", "16", "20", "24"]);
|
|
72
|
+
await clicar(opcoes[3]);
|
|
73
|
+
assert.deepEqual(chamadas.at(-1), ["insertHTML", false, '<span style="font-size: var(--umds-primitive-font-size-sm);">Parecer</span>']);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
test("a cor vem da paleta do DS e vira var() do token; sem seleção pede a seleção", async () => {
|
|
77
|
+
const m = await abrir({ toolbar: ["textColor"] });
|
|
78
|
+
janela.getSelection().removeAllRanges();
|
|
79
|
+
await clicar(botao(m, "Cor do texto"));
|
|
80
|
+
const vermelho = () => m.raiz.querySelector('[role="radio"][aria-label="Vermelho"]');
|
|
81
|
+
await clicar(vermelho());
|
|
82
|
+
assert.match(m.raiz.textContent, /Selecione o texto antes de aplicar/);
|
|
83
|
+
assert.equal(chamadas.length, 0);
|
|
84
|
+
selecionar(m);
|
|
85
|
+
await clicar(vermelho());
|
|
86
|
+
assert.deepEqual(chamadas.at(-1), ["insertHTML", false, '<span style="color: var(--umds-primitive-red-pure);">Parecer</span>']);
|
|
87
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** SegmentedControl com contador (count) no Vue (DOM do jsdom). */
|
|
2
|
+
import { test, after } from "node:test";
|
|
3
|
+
import assert from "node:assert/strict";
|
|
4
|
+
import { montar, clicar } from "./dom.mjs";
|
|
5
|
+
|
|
6
|
+
const montados = [];
|
|
7
|
+
const abrir = async (props) => {
|
|
8
|
+
const m = await montar("SegmentedControl/SegmentedControl.vue", props);
|
|
9
|
+
montados.push(m);
|
|
10
|
+
return m;
|
|
11
|
+
};
|
|
12
|
+
after(() => montados.forEach((m) => m.desmontar()));
|
|
13
|
+
|
|
14
|
+
const FILA = [
|
|
15
|
+
{ label: "Todas", value: "todas", count: 31 },
|
|
16
|
+
{ label: "Minhas", value: "minhas", count: 0 },
|
|
17
|
+
{ label: "Arquivadas", value: "arquivadas" },
|
|
18
|
+
{ label: "Vazias", value: "vazias", count: "" },
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
test("a pílula do contador vem depois do texto; 0 aparece, vazio e ausente não", async () => {
|
|
22
|
+
const m = await abrir({ label: "Fila", options: FILA });
|
|
23
|
+
const itens = [...m.raiz.querySelectorAll(".umds-segmented__item")];
|
|
24
|
+
assert.equal(itens[0].querySelector(".umds-segmented__count").textContent.trim(), "31");
|
|
25
|
+
assert.equal(itens[1].querySelector(".umds-segmented__count").textContent.trim(), "0");
|
|
26
|
+
assert.equal(itens[2].querySelector(".umds-segmented__count"), null);
|
|
27
|
+
assert.equal(itens[3].querySelector(".umds-segmented__count"), null);
|
|
28
|
+
assert.ok(itens[0].querySelector(".umds-segmented__conteudo").lastElementChild.classList.contains("umds-segmented__count"));
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test("a escolha segue funcionando com contador", async () => {
|
|
32
|
+
const vistos = [];
|
|
33
|
+
const m = await abrir({ label: "Fila", options: FILA, defaultValue: "todas", onChange: (v) => vistos.push(v) });
|
|
34
|
+
const radios = [...m.raiz.querySelectorAll('input[type="radio"]')];
|
|
35
|
+
assert.equal(radios[0].checked, true);
|
|
36
|
+
await clicar(m.raiz.querySelectorAll(".umds-segmented__item")[1]);
|
|
37
|
+
assert.deepEqual(vistos, ["minhas"]);
|
|
38
|
+
assert.equal(m.raiz.querySelectorAll(".umds-segmented__count").length, 2);
|
|
39
|
+
});
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Select no Vue: open/onOpenChange, gatilho com ícone e amostra, variantes de filtro
|
|
3
|
+
* e a lista por cima de diálogo (DOM do jsdom).
|
|
4
|
+
*/
|
|
5
|
+
import { test, after } from "node:test";
|
|
6
|
+
import assert from "node:assert/strict";
|
|
7
|
+
import { montar, proximoTick, clicar, teclar, documento, janela } from "./dom.mjs";
|
|
8
|
+
|
|
9
|
+
const montados = [];
|
|
10
|
+
const abrir = async (props, slots) => {
|
|
11
|
+
const m = await montar("Select/Select.vue", props, slots);
|
|
12
|
+
montados.push(m);
|
|
13
|
+
return m;
|
|
14
|
+
};
|
|
15
|
+
after(() => montados.forEach((m) => m.desmontar()));
|
|
16
|
+
|
|
17
|
+
const OPCOES = [
|
|
18
|
+
{ label: "Urgente", value: "urgente" },
|
|
19
|
+
{ label: "Revisão", value: "revisao" },
|
|
20
|
+
];
|
|
21
|
+
const combo = (m) => m.raiz.querySelector('[role="combobox"]');
|
|
22
|
+
const lista = (m) => m.raiz.querySelector('[role="listbox"]');
|
|
23
|
+
|
|
24
|
+
test("open controlado mostra a lista sem clique; false não mostra", async () => {
|
|
25
|
+
const aberto = await abrir({ ariaLabel: "x", options: OPCOES, open: true });
|
|
26
|
+
assert.ok(lista(aberto));
|
|
27
|
+
assert.equal(combo(aberto).getAttribute("aria-expanded"), "true");
|
|
28
|
+
const fechado = await abrir({ ariaLabel: "x", options: OPCOES, open: false });
|
|
29
|
+
assert.equal(lista(fechado), null);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
test("sem a prop open o Select é não controlado (Vue não vira false)", async () => {
|
|
33
|
+
const m = await abrir({ ariaLabel: "x", options: OPCOES });
|
|
34
|
+
assert.equal(lista(m), null);
|
|
35
|
+
await clicar(combo(m));
|
|
36
|
+
assert.ok(lista(m), "abriu sozinho");
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test("controlado: o clique só avisa; quem abre é o pai", async () => {
|
|
40
|
+
const chamadas = [];
|
|
41
|
+
const m = await abrir({ ariaLabel: "x", options: OPCOES, open: false, onOpenChange: (v) => chamadas.push(v) });
|
|
42
|
+
await clicar(combo(m));
|
|
43
|
+
assert.deepEqual(chamadas, [true]);
|
|
44
|
+
assert.equal(lista(m), null);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
test("controlado aberto: opção, Esc e clique fora pedem para fechar", async () => {
|
|
48
|
+
const chamadas = [];
|
|
49
|
+
const m = await abrir({ ariaLabel: "x", options: OPCOES, open: true, onOpenChange: (v) => chamadas.push(v) });
|
|
50
|
+
await clicar(m.raiz.querySelectorAll('[role="option"]')[0]);
|
|
51
|
+
assert.equal(chamadas.at(-1), false);
|
|
52
|
+
chamadas.length = 0;
|
|
53
|
+
await teclar(combo(m), "Escape");
|
|
54
|
+
assert.equal(chamadas.at(-1), false);
|
|
55
|
+
chamadas.length = 0;
|
|
56
|
+
documento.body.dispatchEvent(new janela.MouseEvent("mousedown", { bubbles: true }));
|
|
57
|
+
await proximoTick();
|
|
58
|
+
assert.deepEqual(chamadas, [false]);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
test("o clique fora não avisa quando a lista está fechada", async () => {
|
|
62
|
+
const chamadas = [];
|
|
63
|
+
await abrir({ ariaLabel: "x", options: OPCOES, open: false, onOpenChange: (v) => chamadas.push(v) });
|
|
64
|
+
documento.body.dispatchEvent(new janela.MouseEvent("mousedown", { bubbles: true }));
|
|
65
|
+
await proximoTick();
|
|
66
|
+
assert.deepEqual(chamadas, []);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
test("triggerIcon, triggerSwatch e aria-required", async () => {
|
|
70
|
+
const { faFilter } = await import("@fortawesome/free-solid-svg-icons");
|
|
71
|
+
const m = await abrir({
|
|
72
|
+
ariaLabel: "x",
|
|
73
|
+
options: OPCOES,
|
|
74
|
+
required: true,
|
|
75
|
+
triggerIcon: faFilter,
|
|
76
|
+
triggerSwatch: "var(--umds-semantic-color-primary-pure)",
|
|
77
|
+
});
|
|
78
|
+
const icone = m.raiz.querySelector(".umds-select__trigger-icon");
|
|
79
|
+
assert.equal(icone.getAttribute("aria-hidden"), "true");
|
|
80
|
+
assert.equal(icone.querySelector("svg").getAttribute("data-icon"), "filter");
|
|
81
|
+
const amostra = m.raiz.querySelector(".umds-select__swatch");
|
|
82
|
+
assert.equal(amostra.getAttribute("aria-hidden"), "true");
|
|
83
|
+
assert.match(amostra.getAttribute("style"), /--umds-semantic-color-primary-pure/);
|
|
84
|
+
assert.equal(combo(m).getAttribute("aria-required"), "true");
|
|
85
|
+
const sem = await abrir({ ariaLabel: "x", options: OPCOES });
|
|
86
|
+
assert.equal(sem.raiz.querySelector(".umds-select__swatch"), null);
|
|
87
|
+
assert.equal(combo(sem).getAttribute("aria-required"), null);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
test("search e combo escrevem a classe do filtro e a própria", async () => {
|
|
91
|
+
const s = await abrir({ ariaLabel: "x", options: OPCOES, variant: "search" });
|
|
92
|
+
assert.ok(s.raiz.querySelector(".umds-select--filter.umds-select--filter-search"));
|
|
93
|
+
const c = await abrir({ ariaLabel: "x", options: OPCOES, variant: "combo" });
|
|
94
|
+
assert.ok(c.raiz.querySelector(".umds-select--filter.umds-select--filter-combo"));
|
|
95
|
+
assert.equal(c.raiz.querySelector(".umds-select--filter-search"), null);
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
test("dentro de role=dialog a lista vira fixed; fora, não", async () => {
|
|
99
|
+
const alvo = documento.createElement("div");
|
|
100
|
+
alvo.setAttribute("role", "dialog");
|
|
101
|
+
alvo.setAttribute("aria-label", "Filtros");
|
|
102
|
+
documento.body.append(alvo);
|
|
103
|
+
const { createApp, h } = await import("vue");
|
|
104
|
+
const { pathToFileURL } = await import("node:url");
|
|
105
|
+
const { resolve } = await import("node:path");
|
|
106
|
+
const modulo = await import(pathToFileURL(resolve(process.cwd(), "src/components/Select/Select.vue")).href);
|
|
107
|
+
const app = createApp({ render: () => h(modulo.default, { ariaLabel: "x", options: OPCOES }) });
|
|
108
|
+
app.mount(alvo);
|
|
109
|
+
await clicar(alvo.querySelector('[role="combobox"]'));
|
|
110
|
+
const dentro = alvo.querySelector(".umds-select__dropdown");
|
|
111
|
+
assert.ok(alvo.querySelector(".umds-select--floating"));
|
|
112
|
+
assert.equal(dentro.style.position, "fixed");
|
|
113
|
+
app.unmount();
|
|
114
|
+
alvo.remove();
|
|
115
|
+
|
|
116
|
+
const m = await abrir({ ariaLabel: "x", options: OPCOES });
|
|
117
|
+
await clicar(combo(m));
|
|
118
|
+
assert.equal(m.raiz.querySelector(".umds-select--floating"), null);
|
|
119
|
+
assert.equal(m.raiz.querySelector(".umds-select__dropdown").style.position, "");
|
|
120
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/** Select: filtro (tamanho, fundo) e cor por opção no Vue (DOM do jsdom). */
|
|
2
|
+
import { test, after } from "node:test";
|
|
3
|
+
import assert from "node:assert/strict";
|
|
4
|
+
import { montar, clicar } from "./dom.mjs";
|
|
5
|
+
|
|
6
|
+
const montados = [];
|
|
7
|
+
const abrir = async (props) => {
|
|
8
|
+
const m = await montar("Select/Select.vue", props);
|
|
9
|
+
montados.push(m);
|
|
10
|
+
return m;
|
|
11
|
+
};
|
|
12
|
+
after(() => montados.forEach((m) => m.desmontar()));
|
|
13
|
+
|
|
14
|
+
const MARCADORES = [
|
|
15
|
+
{ label: "Urgente", value: "urgente", color: "var(--umds-semantic-color-feedback-negative-pure)" },
|
|
16
|
+
{ label: "Revisão", value: "revisao", color: "var(--umds-semantic-color-primary-pure)" },
|
|
17
|
+
{ label: "Sem marcador", value: "nenhum" },
|
|
18
|
+
];
|
|
19
|
+
const raiz = (m) => m.raiz.querySelector(".umds-select");
|
|
20
|
+
|
|
21
|
+
test("as variantes de filtro nascem no tamanho sm; size explícito manda; o padrão segue md", async () => {
|
|
22
|
+
for (const variant of ["filter", "search", "combo"]) {
|
|
23
|
+
const m = await abrir({ ariaLabel: "x", options: MARCADORES, variant });
|
|
24
|
+
assert.ok(raiz(m).classList.contains("umds-select--sm"), variant);
|
|
25
|
+
}
|
|
26
|
+
const md = await abrir({ ariaLabel: "x", options: MARCADORES, variant: "filter", size: "md" });
|
|
27
|
+
assert.ok(raiz(md).classList.contains("umds-select--md"));
|
|
28
|
+
const padrao = await abrir({ ariaLabel: "x", options: MARCADORES });
|
|
29
|
+
assert.ok(raiz(padrao).classList.contains("umds-select--md") && !raiz(padrao).classList.contains("umds-select--sm"));
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
test("--has-value só com valor escolhido numa variante de filtro", async () => {
|
|
33
|
+
const sem = await abrir({ ariaLabel: "x", options: MARCADORES, variant: "filter", placeholder: "Marcadores" });
|
|
34
|
+
assert.ok(!raiz(sem).classList.contains("umds-select--has-value"));
|
|
35
|
+
const com = await abrir({ ariaLabel: "x", options: MARCADORES, variant: "filter", placeholder: "Marcadores", value: "urgente" });
|
|
36
|
+
assert.ok(raiz(com).classList.contains("umds-select--has-value"));
|
|
37
|
+
const padrao = await abrir({ ariaLabel: "x", options: MARCADORES, placeholder: "Marcadores", value: "urgente" });
|
|
38
|
+
assert.ok(!raiz(padrao).classList.contains("umds-select--has-value"));
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test("a lista mostra uma amostra por opção com color", async () => {
|
|
42
|
+
const m = await abrir({ ariaLabel: "x", options: MARCADORES, variant: "filter" });
|
|
43
|
+
await clicar(m.raiz.querySelector('[role="combobox"]'));
|
|
44
|
+
const opcoes = [...m.raiz.querySelectorAll('[role="option"]')];
|
|
45
|
+
assert.equal(opcoes[0].querySelector(".umds-select__swatch").getAttribute("aria-hidden"), "true");
|
|
46
|
+
assert.match(opcoes[0].querySelector(".umds-select__swatch").getAttribute("style"), /feedback-negative-pure/);
|
|
47
|
+
assert.ok(opcoes[1].querySelector(".umds-select__swatch"));
|
|
48
|
+
assert.equal(opcoes[2].querySelector(".umds-select__swatch"), null);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
test("o gatilho ganha a cor da opção escolhida; triggerSwatch manda; sem valor e múltipla não pintam", async () => {
|
|
52
|
+
const escolhida = await abrir({ ariaLabel: "x", options: MARCADORES, value: "revisao", placeholder: "Marcadores" });
|
|
53
|
+
assert.match(escolhida.raiz.querySelector(".umds-select__trigger .umds-select__swatch").getAttribute("style"), /primary-pure/);
|
|
54
|
+
const explicita = await abrir({ ariaLabel: "x", options: MARCADORES, value: "urgente", triggerSwatch: "var(--umds-semantic-color-feedback-positive-pure)" });
|
|
55
|
+
const amostras = explicita.raiz.querySelectorAll(".umds-select__trigger .umds-select__swatch");
|
|
56
|
+
assert.equal(amostras.length, 1);
|
|
57
|
+
assert.match(amostras[0].getAttribute("style"), /feedback-positive-pure/);
|
|
58
|
+
const vazio = await abrir({ ariaLabel: "x", options: MARCADORES, placeholder: "Marcadores" });
|
|
59
|
+
assert.equal(vazio.raiz.querySelector(".umds-select__trigger .umds-select__swatch"), null);
|
|
60
|
+
const multipla = await abrir({ ariaLabel: "x", options: MARCADORES, multiple: true, value: ["urgente", "revisao"] });
|
|
61
|
+
assert.equal(multipla.raiz.querySelector(".umds-select__trigger .umds-select__swatch"), null);
|
|
62
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** StatCard: segunda medida e valueTone no Vue (DOM do jsdom). */
|
|
2
|
+
import { test, after } from "node:test";
|
|
3
|
+
import assert from "node:assert/strict";
|
|
4
|
+
import { montar } from "./dom.mjs";
|
|
5
|
+
|
|
6
|
+
const montados = [];
|
|
7
|
+
const abrir = async (props) => {
|
|
8
|
+
const m = await montar("StatCard/StatCard.vue", props);
|
|
9
|
+
montados.push(m);
|
|
10
|
+
return m;
|
|
11
|
+
};
|
|
12
|
+
after(() => montados.forEach((m) => m.desmontar()));
|
|
13
|
+
|
|
14
|
+
test("secondaryValue e secondaryLabel vêm depois do corpo, e o número principal segue antes do rótulo", async () => {
|
|
15
|
+
const m = await abrir({ value: "22,31%", label: "Eficiência", description: "Meu Setor", secondaryValue: "14,11%", secondaryLabel: "Geral", labelPosition: "top" });
|
|
16
|
+
const raiz = m.raiz.querySelector(".umds-stat-card");
|
|
17
|
+
assert.ok(raiz.classList.contains("umds-stat-card--com-secundaria"));
|
|
18
|
+
assert.equal(raiz.lastElementChild.className, "umds-stat-card__secundaria");
|
|
19
|
+
assert.equal(raiz.querySelector(".umds-stat-card__valor-secundario").textContent.trim(), "14,11%");
|
|
20
|
+
assert.equal(raiz.querySelector(".umds-stat-card__rotulo-secundario").textContent.trim(), "Geral");
|
|
21
|
+
const texto = raiz.textContent;
|
|
22
|
+
assert.ok(texto.indexOf("22,31%") < texto.indexOf("Eficiência"));
|
|
23
|
+
assert.ok(texto.indexOf("Eficiência") < texto.indexOf("14,11%"));
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test("secondaryValue 0 aparece; vazio e ausente não", async () => {
|
|
27
|
+
const zero = await abrir({ value: "5", label: "x", secondaryValue: 0 });
|
|
28
|
+
assert.equal(zero.raiz.querySelector(".umds-stat-card__valor-secundario").textContent.trim(), "0");
|
|
29
|
+
const vazio = await abrir({ value: "5", label: "x", secondaryValue: "" });
|
|
30
|
+
assert.equal(vazio.raiz.querySelector(".umds-stat-card__secundaria"), null);
|
|
31
|
+
const sem = await abrir({ value: "5", label: "x" });
|
|
32
|
+
assert.equal(sem.raiz.querySelector(".umds-stat-card__secundaria"), null);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test("valueTone escreve a classe do tom; default e ausente não; a variant do ícone fica", async () => {
|
|
36
|
+
const n = await abrir({ value: "5", label: "x", valueTone: "negative", variant: "positive" });
|
|
37
|
+
const c = n.raiz.querySelector(".umds-stat-card").classList;
|
|
38
|
+
assert.ok(c.contains("umds-stat-card--valor-negative") && c.contains("umds-stat-card--positive"));
|
|
39
|
+
const d = await abrir({ value: "5", label: "x", valueTone: "default" });
|
|
40
|
+
assert.doesNotMatch(d.raiz.querySelector(".umds-stat-card").className, /valor-/);
|
|
41
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** Toast com ação e detalhes no Vue (DOM do jsdom; o Toast vai por Teleport para o body). */
|
|
2
|
+
import { test, after } from "node:test";
|
|
3
|
+
import assert from "node:assert/strict";
|
|
4
|
+
import { montar, documento, clicar, proximoTick } from "./dom.mjs";
|
|
5
|
+
|
|
6
|
+
const montados = [];
|
|
7
|
+
const abrir = async (props) => {
|
|
8
|
+
const m = await montar("Toast/Toast.vue", props);
|
|
9
|
+
montados.push(m);
|
|
10
|
+
await proximoTick();
|
|
11
|
+
return m;
|
|
12
|
+
};
|
|
13
|
+
after(() => montados.forEach((m) => m.desmontar()));
|
|
14
|
+
|
|
15
|
+
const botao = (nome) => [...documento.querySelectorAll(".umds-toast button")].find((b) => b.textContent.trim() === nome || b.getAttribute("aria-label") === nome);
|
|
16
|
+
|
|
17
|
+
test("actionLabel com onAction desenha o botão; acionar chama onAction e depois fecha", async () => {
|
|
18
|
+
const ordem = [];
|
|
19
|
+
const m = await abrir({ open: true, message: "Despacho enviado", actionLabel: "Desfazer", onAction: () => ordem.push("acao"), onClose: () => ordem.push("fechar") });
|
|
20
|
+
await clicar(botao("Desfazer"));
|
|
21
|
+
assert.deepEqual(ordem, ["acao", "fechar"]);
|
|
22
|
+
m.desmontar();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test("sem onAction (ou sem actionLabel) não há botão de ação", async () => {
|
|
26
|
+
const a = await abrir({ open: true, message: "x", actionLabel: "Desfazer" });
|
|
27
|
+
assert.equal(documento.querySelector(".umds-toast__action"), null);
|
|
28
|
+
a.desmontar();
|
|
29
|
+
const b = await abrir({ open: true, message: "x", onAction: () => {} });
|
|
30
|
+
assert.equal(documento.querySelector(".umds-toast__action"), null);
|
|
31
|
+
b.desmontar();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test("details vira uma lista de linhas; sem details não há lista", async () => {
|
|
35
|
+
const m = await abrir({ open: true, message: "3 anexos não enviados", details: ["Anexo 1 acima de 10 MB", "Anexo 2 sem assunto"] });
|
|
36
|
+
const itens = [...documento.querySelectorAll(".umds-toast__details li")].map((l) => l.textContent.trim());
|
|
37
|
+
assert.deepEqual(itens, ["Anexo 1 acima de 10 MB", "Anexo 2 sem assunto"]);
|
|
38
|
+
m.desmontar();
|
|
39
|
+
const sem = await abrir({ open: true, message: "Salvo" });
|
|
40
|
+
assert.equal(documento.querySelector(".umds-toast__details"), null);
|
|
41
|
+
sem.desmontar();
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
test("o botão de fechar continua ao lado da ação", async () => {
|
|
45
|
+
const m = await abrir({ open: true, message: "x", actionLabel: "Desfazer", onAction: () => {} });
|
|
46
|
+
assert.ok(botao("Fechar notificação"));
|
|
47
|
+
m.desmontar();
|
|
48
|
+
});
|