mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 02:54:11 +08:00
tests: color date/time ios14 tests (#9019)
This commit is contained in:

committed by
GitHub

parent
b3f9c0d0ac
commit
05faa867d0
@ -1,8 +1,8 @@
|
|||||||
import * as TKUnit from '../../tk-unit';
|
import * as TKUnit from '../../tk-unit';
|
||||||
import * as testModule from '../../ui-test';
|
import * as testModule from '../../ui-test';
|
||||||
import * as datePickerTestsNative from './date-picker-tests-native';
|
import * as datePickerTestsNative from './date-picker-tests-native';
|
||||||
import * as color from '@nativescript/core/color';
|
|
||||||
import * as platform from '@nativescript/core/platform';
|
import * as platform from '@nativescript/core/platform';
|
||||||
|
import { Color } from '@nativescript/core';
|
||||||
|
|
||||||
// >> date-picker-require
|
// >> date-picker-require
|
||||||
import * as datePickerModule from '@nativescript/core/ui/date-picker';
|
import * as datePickerModule from '@nativescript/core/ui/date-picker';
|
||||||
@ -77,10 +77,13 @@ export class DatePickerTest extends testModule.UITest<datePickerModule.DatePicke
|
|||||||
|
|
||||||
public test_set_color() {
|
public test_set_color() {
|
||||||
if (platform.Device.os === platform.platformNames.ios) {
|
if (platform.Device.os === platform.platformNames.ios) {
|
||||||
this.testView.color = new color.Color('red');
|
const SUPPORT_TEXT_COLOR = parseFloat(platform.Device.osVersion) < 14.0;
|
||||||
|
if (SUPPORT_TEXT_COLOR) {
|
||||||
|
this.testView.color = new Color('red');
|
||||||
TKUnit.assertEqual(this.testView.color.ios.CGColor, this.testView.ios.valueForKey('textColor').CGColor, 'datePicker.color');
|
TKUnit.assertEqual(this.testView.color.ios.CGColor, this.testView.ios.valueForKey('textColor').CGColor, 'datePicker.color');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public test_WhenCreated_YearIsCurrentYear() {
|
public test_WhenCreated_YearIsCurrentYear() {
|
||||||
const actualValue = this.testView.year;
|
const actualValue = this.testView.year;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import * as TKUnit from '../../tk-unit';
|
import * as TKUnit from '../../tk-unit';
|
||||||
import * as testModule from '../../ui-test';
|
import * as testModule from '../../ui-test';
|
||||||
import * as timePickerTestsNative from './time-picker-tests-native';
|
import * as timePickerTestsNative from './time-picker-tests-native';
|
||||||
import * as color from '@nativescript/core/color';
|
|
||||||
import * as platform from '@nativescript/core/platform';
|
import * as platform from '@nativescript/core/platform';
|
||||||
import * as helper from '../../ui-helper';
|
import * as helper from '../../ui-helper';
|
||||||
|
import { Color } from '@nativescript/core';
|
||||||
|
|
||||||
// >> require-time-picker
|
// >> require-time-picker
|
||||||
import * as timePickerModule from '@nativescript/core/ui/time-picker';
|
import * as timePickerModule from '@nativescript/core/ui/time-picker';
|
||||||
@ -50,10 +50,13 @@ export class TimePickerTest extends testModule.UITest<timePickerModule.TimePicke
|
|||||||
// Supported in iOS only.
|
// Supported in iOS only.
|
||||||
public test_set_color() {
|
public test_set_color() {
|
||||||
if (platform.Device.os === platform.platformNames.ios) {
|
if (platform.Device.os === platform.platformNames.ios) {
|
||||||
this.testView.color = new color.Color('red');
|
const SUPPORT_TEXT_COLOR = parseFloat(platform.Device.osVersion) < 14.0;
|
||||||
|
if (SUPPORT_TEXT_COLOR) {
|
||||||
|
this.testView.color = new Color('red');
|
||||||
TKUnit.assertEqual(this.testView.color.ios.CGColor, this.testView.ios.valueForKey('textColor').CGColor, 'timePicker.color');
|
TKUnit.assertEqual(this.testView.color.ios.CGColor, this.testView.ios.valueForKey('textColor').CGColor, 'timePicker.color');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public test_WhenCreated_MinuteIntervalIs1() {
|
public test_WhenCreated_MinuteIntervalIs1() {
|
||||||
let actualValue = this.testView.minuteInterval;
|
let actualValue = this.testView.minuteInterval;
|
||||||
|
Reference in New Issue
Block a user