1- import { beforeEach , describe , expect , test } from 'vitest'
1+ import { describe , expect , it } from 'vitest'
22import { SnapshotService } from '@/lib/logs/execution/snapshot/service'
33import type { WorkflowState } from '@/lib/logs/types'
44
55describe ( 'SnapshotService' , ( ) => {
6- let service : SnapshotService
7-
8- beforeEach ( ( ) => {
9- service = new SnapshotService ( )
10- } )
11-
126 describe ( 'computeStateHash' , ( ) => {
13- test ( 'should generate consistent hashes for identical states' , ( ) => {
7+ it . concurrent ( 'should generate consistent hashes for identical states' , ( ) => {
8+ const service = new SnapshotService ( )
149 const state : WorkflowState = {
1510 blocks : {
1611 block1 : {
@@ -39,7 +34,8 @@ describe('SnapshotService', () => {
3934 expect ( hash1 ) . toHaveLength ( 64 ) // SHA-256 hex string
4035 } )
4136
42- test ( 'should ignore position changes' , ( ) => {
37+ it . concurrent ( 'should ignore position changes' , ( ) => {
38+ const service = new SnapshotService ( )
4339 const baseState : WorkflowState = {
4440 blocks : {
4541 block1 : {
@@ -77,7 +73,8 @@ describe('SnapshotService', () => {
7773 expect ( hash1 ) . toBe ( hash2 )
7874 } )
7975
80- test ( 'should detect meaningful changes' , ( ) => {
76+ it . concurrent ( 'should detect meaningful changes' , ( ) => {
77+ const service = new SnapshotService ( )
8178 const baseState : WorkflowState = {
8279 blocks : {
8380 block1 : {
@@ -128,7 +125,8 @@ describe('SnapshotService', () => {
128125 expect ( hash1 ) . not . toBe ( hash2 )
129126 } )
130127
131- test ( 'should handle edge order consistently' , ( ) => {
128+ it . concurrent ( 'should handle edge order consistently' , ( ) => {
129+ const service = new SnapshotService ( )
132130 const state1 : WorkflowState = {
133131 blocks : { } ,
134132 edges : [
@@ -155,7 +153,8 @@ describe('SnapshotService', () => {
155153 expect ( hash1 ) . toBe ( hash2 ) // Should be same despite different order
156154 } )
157155
158- test ( 'should handle empty states' , ( ) => {
156+ it . concurrent ( 'should handle empty states' , ( ) => {
157+ const service = new SnapshotService ( )
159158 const emptyState : WorkflowState = {
160159 blocks : { } ,
161160 edges : [ ] ,
@@ -167,7 +166,8 @@ describe('SnapshotService', () => {
167166 expect ( hash ) . toHaveLength ( 64 )
168167 } )
169168
170- test ( 'should handle complex nested structures' , ( ) => {
169+ it . concurrent ( 'should handle complex nested structures' , ( ) => {
170+ const service = new SnapshotService ( )
171171 const complexState : WorkflowState = {
172172 blocks : {
173173 block1 : {
@@ -224,7 +224,8 @@ describe('SnapshotService', () => {
224224 expect ( hash ) . toBe ( hash2 )
225225 } )
226226
227- test ( 'should include variables in hash computation' , ( ) => {
227+ it . concurrent ( 'should include variables in hash computation' , ( ) => {
228+ const service = new SnapshotService ( )
228229 const stateWithVariables : WorkflowState = {
229230 blocks : { } ,
230231 edges : [ ] ,
@@ -253,7 +254,8 @@ describe('SnapshotService', () => {
253254 expect ( hashWith ) . not . toBe ( hashWithout )
254255 } )
255256
256- test ( 'should detect changes in variable values' , ( ) => {
257+ it . concurrent ( 'should detect changes in variable values' , ( ) => {
258+ const service = new SnapshotService ( )
257259 const state1 : WorkflowState = {
258260 blocks : { } ,
259261 edges : [ ] ,
@@ -290,7 +292,8 @@ describe('SnapshotService', () => {
290292 expect ( hash1 ) . not . toBe ( hash2 )
291293 } )
292294
293- test ( 'should generate consistent hashes for states with variables' , ( ) => {
295+ it . concurrent ( 'should generate consistent hashes for states with variables' , ( ) => {
296+ const service = new SnapshotService ( )
294297 const stateWithVariables : WorkflowState = {
295298 blocks : {
296299 block1 : {
0 commit comments