Skip to content

Commit

Permalink
chore: unit tests for XKeys.calculateDelta()
Browse files Browse the repository at this point in the history
  • Loading branch information
nytamin committed Apr 7, 2021
1 parent f588128 commit df7d9b6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/__tests__/xkeys.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,17 @@ describe('Recorded tests', () => {
})
})
})
describe('Unit tests', () => {
test('calculateDelta', () => {
expect(XKeys.calculateDelta(100, 100)).toBe(0)
expect(XKeys.calculateDelta(110, 100)).toBe(10)
expect(XKeys.calculateDelta(90, 100)).toBe(-10)
expect(XKeys.calculateDelta(0, 255)).toBe(1)
expect(XKeys.calculateDelta(5, 250)).toBe(11)
expect(XKeys.calculateDelta(255, 0)).toBe(-1)
expect(XKeys.calculateDelta(250, 5)).toBe(-11)
})
})

/** Data sent to the panel */
let sentData: string[] = []
Expand Down

0 comments on commit df7d9b6

Please sign in to comment.