Skip to content

Commit 6dd526a

Browse files
committed
tests: Move Snapshots to Inline
1 parent 9a0f1b8 commit 6dd526a

File tree

5 files changed

+64
-76
lines changed

5 files changed

+64
-76
lines changed

.npmrc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ save-exact=true
55
hoist=true
66
shamefully-hoist=true
77

8-
# Use LTE Node version
9-
engine-strict=true
10-
node-version=20.10.0
11-
use-node-version=20.10.0
12-
138
# Workspace Settings
149
link-workspace-packages=true
1510
prefer-workspace-packages=true

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v20.10.0
1+
v22.16.0

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"url": "https://github.com/0xTheProDev/Operational-Transformation.git"
2626
},
2727
"engines": {
28-
"node": ">= 20",
28+
"node": ">= 22",
2929
"pnpm": ">= 9"
3030
},
3131
"devDependencies": {

packages/utils/__tests__/__snapshots__/styles.spec.ts.snap

Lines changed: 0 additions & 66 deletions
This file was deleted.

packages/utils/__tests__/styles.spec.ts

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,53 @@ describe("Style Utility Functions", () => {
5353
className: "test-class",
5454
cursorColor: "#000",
5555
});
56-
expect(appendChildSpy.mock.calls).toMatchSnapshot();
56+
expect(appendChildSpy.mock.calls).toMatchInlineSnapshot(`
57+
[
58+
[
59+
<style>
60+
61+
/**
62+
* Copyright © 2021 - 2024 Progyan Bhattacharya
63+
* Licensed under the MIT License.
64+
* See LICENSE in the project root for license information.
65+
*/
66+
67+
.test-class-cursor {
68+
position: absolute;
69+
background-color: transparent;
70+
border-left: 2px solid #000;
71+
}
72+
73+
.test-class-selection {
74+
position: absolute;
75+
opacity: 0.5;
76+
background-color: #000;
77+
border-left: 2px solid #000;
78+
}
79+
80+
.test-class-tooltip {
81+
opacity: 1;
82+
padding: 2px 8px;
83+
font-size: 12px;
84+
white-space: nowrap;
85+
border-radius: 2px;
86+
color: #ffffff;
87+
border-color: #000;
88+
background-color: #000;
89+
}
90+
91+
.test-class-widget {
92+
height: 20px;
93+
padding-bottom: 0 !important;
94+
position: absolute;
95+
transition: all 0.1s linear;
96+
z-index: 10000;
97+
}
98+
99+
</style>,
100+
],
101+
]
102+
`);
57103
});
58104

59105
it("should not inject same style rules twice", async () => {
@@ -113,7 +159,14 @@ describe("Style Utility Functions", () => {
113159
className: "test-class",
114160
textContent: "user-name",
115161
});
116-
expect(tooltip).toMatchSnapshot();
162+
expect(tooltip).toMatchInlineSnapshot(`
163+
<div
164+
class="test-class"
165+
role="tooltip"
166+
>
167+
user-name
168+
</div>
169+
`);
117170
});
118171

119172
it.skip("should retry if DOM update fails once", async () => {
@@ -168,7 +221,13 @@ describe("Style Utility Functions", () => {
168221
className: "test-class",
169222
childElement,
170223
});
171-
expect(tooltip).toMatchSnapshot();
224+
expect(tooltip).toMatchInlineSnapshot(`
225+
<div
226+
class="test-class"
227+
>
228+
<div />
229+
</div>
230+
`);
172231
});
173232

174233
it.skip("should retry if DOM update fails once", async () => {

0 commit comments

Comments
 (0)