1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- import {
- getDiffNE,
- getDiffNW,
- getDiffSE,
- getDiffSW,
- } from 'sentry/components/avatarCropper';
- describe('AvatarCropper', function () {
- describe('getDiffNW', function () {
- it(
- 'should return a negative diff when yDiff and xDiff ' +
- 'are positive (cropper is getting smaller)',
- function () {
- expect(getDiffNW(4, 5)).toEqual(-4.5);
- }
- );
- it(
- 'should return a positive diff when yDiff and xDiff ' +
- 'are negative (cropper is getting bigger)',
- function () {
- expect(getDiffNW(-4, -5)).toEqual(4.5);
- }
- );
- });
- describe('getDiffNE', function () {
- it(
- 'should return a positive diff when yDiff is negative and ' +
- 'xDiff is positive (cropper is getting bigger)',
- function () {
- expect(getDiffNE(-4, 5)).toEqual(4.5);
- }
- );
- it(
- 'should return a negative diff when yDiff is positive and ' +
- 'xDiff is negative (cropper is getting smaller)',
- function () {
- expect(getDiffNE(4, -5)).toEqual(-4.5);
- }
- );
- });
- describe('getDiffSE', function () {
- it(
- 'should return a positive diff when yDiff and ' +
- 'xDiff are positive (cropper is getting bigger)',
- function () {
- expect(getDiffSE(4, 5)).toEqual(4.5);
- }
- );
- it(
- 'should return a negative diff when yDiff and ' +
- 'xDiff are negative (cropper is getting smaller)',
- function () {
- expect(getDiffSE(-4, -5)).toEqual(-4.5);
- }
- );
- });
- describe('getDiffSW', function () {
- it(
- 'should return a positive diff when yDiff is positive and ' +
- 'xDiff is negative (cropper is getting bigger)',
- function () {
- expect(getDiffSW(4, -5)).toEqual(4.5);
- }
- );
- it(
- 'should return a negative diff when yDiff is negative and' +
- 'xDiff is positive (cropper is getting smaller)',
- function () {
- expect(getDiffSW(-4, 5)).toEqual(-4.5);
- }
- );
- });
- });
|