Skip to content

Commit 62a38c9

Browse files
committed
maint(pat modal): Add numbers to test case names for easier starting individual cases.
1 parent 1c21f05 commit 62a38c9

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/pat/modal/modal.test.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ describe("pat-modal", function () {
2121
jest.restoreAllMocks();
2222
});
2323

24-
describe("init", function () {
25-
it("Modal with single element", function () {
24+
describe("1 - init", function () {
25+
it("1.1 - Modal with single element", function () {
2626
$("#lab").html(
2727
[
2828
'<div class="pat-modal" id="modal">',
@@ -41,7 +41,7 @@ describe("pat-modal", function () {
4141
expect($("body").hasClass("modal-active")).toBeTruthy();
4242
});
4343

44-
it("Modal with header ", function () {
44+
it("1.2 - Modal with header ", function () {
4545
$("#lab").html(
4646
[
4747
'<div class="pat-modal" id="modal">',
@@ -59,7 +59,7 @@ describe("pat-modal", function () {
5959
expect($("body").hasClass("modal-active")).toBeTruthy();
6060
});
6161

62-
it("Modal with multiple content items ", function () {
62+
it("1.3 - Modal with multiple content items ", function () {
6363
$("#lab").html(
6464
[
6565
'<div class="pat-modal" id="modal">',
@@ -80,7 +80,7 @@ describe("pat-modal", function () {
8080
expect($("body").hasClass("modal-active")).toBeTruthy();
8181
});
8282

83-
it("Modal with a form that has the pat-modal CSS class", function () {
83+
it("1.4 - Modal with a form that has the pat-modal CSS class", function () {
8484
var $modal, // main modal container
8585
$modalLink; // link that triggers the modal
8686

@@ -115,7 +115,7 @@ describe("pat-modal", function () {
115115
expect($modal.length).toBeGreaterThan(0);
116116
});
117117

118-
it("Modal with single element that specifies a custom close button string", function () {
118+
it("1.5 - Modal with single element that specifies a custom close button string", function () {
119119
$("#lab").html(
120120
[
121121
'<div class="pat-modal" id="modal" data-pat-modal="close-text: Shutdown">',
@@ -132,7 +132,7 @@ describe("pat-modal", function () {
132132
expect($("body").hasClass("modal-active")).toBeTruthy();
133133
});
134134

135-
it("Dispatch pat-modal-ready with a div-modal.", async function () {
135+
it("1.6 - Dispatch pat-modal-ready with a div-modal.", async function () {
136136
document.body.innerHTML = `
137137
<div class="pat-modal" id="modal">
138138
<p>Modal content</p>
@@ -149,7 +149,7 @@ describe("pat-modal", function () {
149149
expect(callback).toHaveBeenCalled();
150150
});
151151

152-
it("Dispatch pat-modal-ready with a inject-modal.", async function () {
152+
it("1.7 - Dispatch pat-modal-ready with a inject-modal.", async function () {
153153
jest.spyOn($, "ajax").mockImplementation(() => deferred);
154154
document.body.innerHTML = `
155155
<a
@@ -171,7 +171,7 @@ describe("pat-modal", function () {
171171
expect(callback).toHaveBeenCalled();
172172
});
173173

174-
it("Submit form, do injection and close overlay.", async function () {
174+
it("1.8 - Submit form, do injection and close overlay.", async function () {
175175
await import("../inject/inject");
176176
const registry = (await import("../../core/registry")).default;
177177

@@ -206,7 +206,7 @@ describe("pat-modal", function () {
206206
expect(document.querySelector("#target2").textContent).toBe("there");
207207
});
208208

209-
it("Submit form, do injection and close overlay with multiple forms.", async function () {
209+
it("1.9 - Submit form, do injection and close overlay with multiple forms.", async function () {
210210
await import("../inject/inject");
211211
const registry = (await import("../../core/registry")).default;
212212

@@ -244,7 +244,7 @@ describe("pat-modal", function () {
244244
expect(document.querySelector("#target").textContent).toBe("hello.");
245245
});
246246

247-
it("Ensure destroy callback isn't called multiple times.", async function () {
247+
it("1.10 - Ensure destroy callback isn't called multiple times.", async function () {
248248
document.body.innerHTML = `
249249
<div id="pat-modal" class="pat-modal">
250250
<button id="close-modal" class="close-panel">close</button>
@@ -266,7 +266,7 @@ describe("pat-modal", function () {
266266
expect(spy_destroy).toHaveBeenCalledTimes(1);
267267
});
268268

269-
it("Ensure destroy callback isn't called multiple times with forms and injection.", async function () {
269+
it("1.11 - Ensure destroy callback isn't called multiple times with forms and injection.", async function () {
270270
const markup = `
271271
<div id="pat-modal" class="pat-modal">
272272
<form action="." class="pat-inject" data-pat-inject="source: body; target: body">

0 commit comments

Comments
 (0)