-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
oatkiller
committed
Jun 29, 2020
1 parent
39894cf
commit 0cb5a35
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
x-pack/plugins/security_solution/public/resolver/models/aabb.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
import { isEqual } from './aabb'; | ||
import { AABB } from '../types'; | ||
|
||
describe('AABB', () => { | ||
const minimumX = 0; | ||
const minimumY = 0; | ||
const maximumX = 0; | ||
const maximumY = 0; | ||
|
||
let aabb: AABB; | ||
|
||
beforeEach(() => { | ||
aabb = { minimum: [minimumX, minimumY], maximum: [maximumX, maximumY] }; | ||
}); | ||
it('should be equal to an AABB with the same values', () => { | ||
expect(isEqual(aabb, { minimum: [minimumX, minimumY], maximum: [maximumX, maximumY] })).toBe( | ||
true | ||
); | ||
}); | ||
|
||
it('should not be equal to an AABB with a different minimum X value', () => { | ||
expect( | ||
isEqual(aabb, { minimum: [minimumX + 1, minimumY], maximum: [maximumX, maximumY] }) | ||
).toBe(false); | ||
}); | ||
it('should not be equal to an AABB with a different minimum Y value', () => { | ||
expect( | ||
isEqual(aabb, { minimum: [minimumX, minimumY + 1], maximum: [maximumX, maximumY] }) | ||
).toBe(false); | ||
}); | ||
it('should not be equal to an AABB with a different maximum X value', () => { | ||
expect( | ||
isEqual(aabb, { minimum: [minimumX, minimumY], maximum: [maximumX + 1, maximumY] }) | ||
).toBe(false); | ||
}); | ||
it('should not be equal to an AABB with a different maximum Y value', () => { | ||
expect( | ||
isEqual(aabb, { minimum: [minimumX, minimumY], maximum: [maximumX, maximumY + 1] }) | ||
).toBe(false); | ||
}); | ||
}); |