Skip to content

Commit

Permalink
fix: invocationTraceDescription.js.
Browse files Browse the repository at this point in the history
  • Loading branch information
asafkorem committed May 8, 2024
1 parent 22cb3fd commit 21c5aaf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
5 changes: 3 additions & 2 deletions detox/src/ios/expectTwoApiCoverage.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,9 @@ describe('expectTwo API Coverage', () => {

await expectToThrow(() => e.element(e.by.id('someId')).longPress('notANumber'));
await expectToThrow(() => e.element(e.by.id('someId')).longPress(1000, 1000));
await expectToThrow(() => e.element(e.by.id('someId')).longPress(1000, { x: 'notANumber', y: 10 }));
await expectToThrow(() => e.element(e.by.id('someId')).longPress(1000, { x: 10, y: 'notANumber' }));
await expectToThrow(() => e.element(e.by.id('someId')).longPress({ x: 'notANumber', y: 10 }, 1000));
await expectToThrow(() => e.element(e.by.id('someId')).longPress(1000, { x: 10, y: 5 }));
await expectToThrow(() => e.element(e.by.id('someId')).longPress({ x: 10, y: 'notANumber' }, 1000));

await expectToThrow(() => e.element(e.by.id('elementToDrag')).longPressAndDrag(1000, 0.5, 0.5, e.by.id('matcherNotElement')));
await expectToThrow(() => e.element(e.by.id('elementToDrag')).longPressAndDrag('notANumber', 0.5, 0.5, e.element(e.by.id('targetElement'))));
Expand Down
6 changes: 0 additions & 6 deletions detox/src/utils/__snapshots__/assertArgument.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ exports[`assertNormalized should throw for null 2`] = `"invalidNumber should be

exports[`assertNormalized should throw for undefined 1`] = `"invalidNumber should be a number, but got undefined (undefined)"`;

exports[`assertNull should throw for "str" 1`] = `"0 expected to be null, but got s (string)"`;

exports[`assertNull should throw for {"key":"val"} 1`] = `"key expected to be null, but got val (string)"`;

exports[`assertNull should throw for 1 1`] = `"undefined is not iterable (cannot read property Symbol(Symbol.iterator))"`;

exports[`assertNumber should throw for "42" 1`] = `"invalidNumber should be a number, but got 42 (string)"`;

exports[`assertNumber should throw for false 1`] = `"invalidNumber should be a number, but got false (boolean)"`;
Expand Down
2 changes: 1 addition & 1 deletion detox/src/utils/invocationTraceDescriptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
adjustSliderToPosition: (newPosition) => `adjust slider to position ${newPosition}`,
clearText: () => 'clear input text',
getAttributes: () => 'get element attributes',
longPress: (point, duration) => `long press${duration !== undefined ? ` for ${duration}ms` : ''}${point !== undefined ? ` at ${JSON.stringify(point)}` : ''}`,
longPress: (point, duration) => `long press${duration !== null ? ` for ${duration}ms` : ''}${point !== null ? ` at ${JSON.stringify(point)}` : ''}`,
longPressAndDrag: (duration, startX, startY, targetElement, endX, endY, speed, holdDuration) =>
`long press and drag from ${startX}, ${startY} to ${endX}, ${endY} with speed ${speed} and hold duration ${holdDuration}`,
multiTap: (times) => `tap ${times} times`,
Expand Down

0 comments on commit 21c5aaf

Please sign in to comment.