Skip to content

Commit

Permalink
Remove IOSOnly suffix from method name
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewrfindley committed Feb 8, 2019
1 parent 6553e4b commit 1d6913c
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion detox/ios/Detox/GREYActions+Detox.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@

@interface GREYActions (Detox)

+ (id<GREYAction>)detoxSetDatePickerDateIOSOnly:(NSString *)dateString withFormat:(NSString *)dateFormat;
+ (id<GREYAction>)detoxSetDatePickerDate:(NSString *)dateString withFormat:(NSString *)dateFormat;

@end
2 changes: 1 addition & 1 deletion detox/ios/Detox/GREYActions+Detox.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

@implementation GREYActions (Detox)

+ (id<GREYAction>)detoxSetDatePickerDateIOSOnly:(NSString *)dateString withFormat:(NSString *)dateFormat
+ (id<GREYAction>)detoxSetDatePickerDate:(NSString *)dateString withFormat:(NSString *)dateFormat
{
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.dateFormat = dateFormat;
Expand Down
4 changes: 2 additions & 2 deletions detox/src/ios/earlgreyapi/GREYActions+Detox.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@


class GREYActions {
static detoxSetDatePickerDateIOSOnlyWithFormat(dateString, dateFormat) {
static detoxSetDatePickerDateWithFormat(dateString, dateFormat) {
if (typeof dateString !== "string") throw new Error("dateString should be a string, but got " + (dateString + (" (" + (typeof dateString + ")"))));
if (typeof dateFormat !== "string") throw new Error("dateFormat should be a string, but got " + (dateFormat + (" (" + (typeof dateFormat + ")"))));
return {
target: {
type: "Class",
value: "GREYActions"
},
method: "detoxSetDatePickerDateIOSOnly:withFormat:",
method: "detoxSetDatePickerDate:withFormat:",
args: [{
type: "NSString",
value: dateString
Expand Down
4 changes: 2 additions & 2 deletions detox/src/ios/expect.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class ScrollColumnToValue extends Action {
class SetDatePickerDate extends Action {
constructor(dateString, dateFormat) {
super();
this._call = invoke.callDirectly(GreyActionsDetox.detoxSetDatePickerDateIOSOnlyWithFormat(dateString, dateFormat));
this._call = invoke.callDirectly(GreyActionsDetox.detoxSetDatePickerDateWithFormat(dateString, dateFormat));
}
}

Expand Down Expand Up @@ -339,7 +339,7 @@ class Element {
async setColumnToValue(column,value) {
return await new ActionInteraction(this, new ScrollColumnToValue(column, value)).execute();
}
async setDatePickerDateIOSOnly(dateString, dateFormat) {
async setDatePickerDate(dateString, dateFormat) {
return await new ActionInteraction(this, new SetDatePickerDate(dateString, dateFormat)).execute();
}
}
Expand Down
6 changes: 3 additions & 3 deletions detox/src/ios/expect.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('expect', async () => {
it(`element by type`, async () => {
await e.expect(e.element(e.by.type('test'))).toBeVisible();
await e.element(e.by.type('UIPickerView')).setColumnToValue(1,"6");
await e.element(e.by.type('UIPickerView')).setDatePickerDateIOSOnly('2019-2-8T05:10:00-08:00', "yyyy-MM-dd'T'HH:mm:ssZZZZZ");
await e.element(e.by.type('UIPickerView')).setDatePickerDate('2019-2-8T05:10:00-08:00', "yyyy-MM-dd'T'HH:mm:ssZZZZZ");
});

it(`element by traits`, async () => {
Expand Down Expand Up @@ -153,8 +153,8 @@ describe('expect', async () => {
await expectToThrow(() => e.element(e.by.id('ScrollView799')).swipe('down', 'NotFastNorSlow'));
await expectToThrow(() => e.element(e.by.id('ScrollView799')).swipe('down', 'NotFastNorSlow', 0.9));
await expectToThrow(() => e.element(e.by.id('ScrollView799')).atIndex('NaN'));
await expectToThrow(() => e.element(e.by.type('UIPickerView')).setDatePickerDateIOSOnly(0, 'mm'));
await expectToThrow(() => e.element(e.by.type('UIPickerView')).setDatePickerDateIOSOnly('something', 0));
await expectToThrow(() => e.element(e.by.type('UIPickerView')).setDatePickerDate(0, 'mm'));
await expectToThrow(() => e.element(e.by.type('UIPickerView')).setDatePickerDate('something', 0));
});

it(`exportGlobals() should export api functions`, async () => {
Expand Down
2 changes: 1 addition & 1 deletion detox/test/e2e/17.datePicker.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe(':ios: DatePicker', () => {
});

it('can select dates on a UIDatePicker', async () => {
await element(by.type('UIDatePicker')).setDatePickerDateIOSOnly('2019-02-06T05:10:00-08:00', "yyyy-MM-dd'T'HH:mm:ssZZZZZ");
await element(by.type('UIDatePicker')).setDatePickerDate('2019-02-06T05:10:00-08:00', "yyyy-MM-dd'T'HH:mm:ssZZZZZ");

await expect(element(by.id('dateTimeLabel'))).toHaveText('choosenDateTime is 2-6-2019 5:10');
});
Expand Down

0 comments on commit 1d6913c

Please sign in to comment.