Skip to content

Commit cc33129

Browse files
authored
test: remove silly tests from accessComposition unit tests (#15158)
Removes some silly tests
1 parent bfe2154 commit cc33129

1 file changed

Lines changed: 0 additions & 40 deletions

File tree

packages/plugin-ecommerce/src/utilities/accessComposition.spec.ts

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -538,24 +538,6 @@ describe('Access Composition Utilities', () => {
538538
})
539539
})
540540

541-
it('should handle async checker that takes time', async () => {
542-
const checker1: Access = async () => {
543-
await new Promise((resolve) => setTimeout(resolve, 10))
544-
return false
545-
}
546-
const checker2: Access = async () => {
547-
await new Promise((resolve) => setTimeout(resolve, 10))
548-
return true
549-
}
550-
551-
const start = Date.now()
552-
const result = await accessOR(checker1, checker2)(mockArgs)
553-
const duration = Date.now() - start
554-
555-
expect(result).toBe(true)
556-
expect(duration).toBeGreaterThanOrEqual(20)
557-
})
558-
559541
it('should handle all checkers returning null/undefined', async () => {
560542
const checker1: Access = async () => null as any
561543
const checker2: Access = async () => undefined as any
@@ -610,28 +592,6 @@ describe('Access Composition Utilities', () => {
610592
expect(result2).toBe(true)
611593
})
612594

613-
it('should handle very large number of checkers in or', async () => {
614-
const checkers: Access[] = Array.from({ length: 100 }, (_, i) => async () => ({
615-
field: { equals: `value${i}` },
616-
}))
617-
618-
const result = await accessOR(...checkers)(mockArgs)
619-
620-
expect(result).toHaveProperty('or')
621-
expect((result as any).or).toHaveLength(100)
622-
})
623-
624-
it('should handle very large number of checkers in and', async () => {
625-
const checkers: Access[] = Array.from({ length: 100 }, (_, i) => async () => ({
626-
field: { equals: `value${i}` },
627-
}))
628-
629-
const result = await accessAND(...checkers)(mockArgs)
630-
631-
expect(result).toHaveProperty('and')
632-
expect((result as any).and).toHaveLength(100)
633-
})
634-
635595
it('should handle alternating true/false in or correctly', async () => {
636596
const checkers: Access[] = [
637597
async () => false,

0 commit comments

Comments
 (0)