@@ -10,7 +10,7 @@ import * as colorModule from '@nativescript/core/color';
1010import * as utils from '@nativescript/core/utils' ;
1111import * as observableModule from '@nativescript/core/data/observable' ;
1212import * as bindable from '@nativescript/core/ui/core/bindable' ;
13- import { CoreTypes , Span , FormattedString } from '@nativescript/core' ;
13+ import { CoreTypes , Span , FormattedString , Utils } from '@nativescript/core' ;
1414import * as labelTestsNative from './label-tests-native' ;
1515import * as fs from '@nativescript/core/file-system' ;
1616
@@ -23,6 +23,8 @@ import * as helper from '../../ui-helper';
2323
2424const testDir = 'ui/label' ;
2525
26+ const expectLayoutRequest = __APPLE__ && Utils . SDK_VERSION >= 18 ;
27+
2628export class LabelTest extends testModule . UITest < LabelModule . Label > {
2729 public create ( ) : LabelModule . Label {
2830 const label = new LabelModule . Label ( ) ;
@@ -633,7 +635,7 @@ export class LabelTest extends testModule.UITest<LabelModule.Label> {
633635 }
634636
635637 public test_SettingTextWhenInFixedSizeGridShouldNotRequestLayout ( ) {
636- this . requestLayoutFixture ( false , '' , ( label ) => {
638+ this . requestLayoutFixture ( expectLayoutRequest , '' , ( label ) => {
637639 label . textWrap = false ;
638640 let host = new GridLayout ( ) ;
639641 host . width = 100 ;
@@ -644,7 +646,7 @@ export class LabelTest extends testModule.UITest<LabelModule.Label> {
644646 }
645647
646648 public test_ChangingTextWhenInFixedSizeGridShouldNotRequestLayout ( ) {
647- this . requestLayoutFixture ( false , 'Hello World' , ( label ) => {
649+ this . requestLayoutFixture ( expectLayoutRequest , 'Hello World' , ( label ) => {
648650 label . textWrap = false ;
649651 let host = new GridLayout ( ) ;
650652 host . width = 100 ;
@@ -655,7 +657,7 @@ export class LabelTest extends testModule.UITest<LabelModule.Label> {
655657 }
656658
657659 public test_SettingTextWhenFixedWidthAndHeightDoesNotRequestLayout ( ) {
658- this . requestLayoutFixture ( false , '' , ( label ) => {
660+ this . requestLayoutFixture ( expectLayoutRequest , '' , ( label ) => {
659661 label . textWrap = false ;
660662 let host = new StackLayout ( ) ;
661663 label . width = 100 ;
@@ -666,7 +668,7 @@ export class LabelTest extends testModule.UITest<LabelModule.Label> {
666668 }
667669
668670 public test_ChangingTextWhenFixedWidthAndHeightDoesNotRequestLayout ( ) {
669- this . requestLayoutFixture ( false , 'Hello World' , ( label ) => {
671+ this . requestLayoutFixture ( expectLayoutRequest , 'Hello World' , ( label ) => {
670672 label . textWrap = false ;
671673 let host = new StackLayout ( ) ;
672674 label . width = 100 ;
@@ -707,7 +709,7 @@ export class LabelTest extends testModule.UITest<LabelModule.Label> {
707709 }
708710
709711 public test_ChangingTextOnSingleLineTextWhenWidthIsSizedToParentAndHeightIsSizedToContentShouldNotRequestLayout ( ) {
710- this . requestLayoutFixture ( false , 'Hello World' , ( label ) => {
712+ this . requestLayoutFixture ( expectLayoutRequest , 'Hello World' , ( label ) => {
711713 label . textWrap = false ;
712714 let host = new StackLayout ( ) ;
713715 host . width = 100 ;
0 commit comments