diff --git a/.github/workflows/apps_automated_android.yml b/.github/workflows/apps_automated_android.yml index b1b55244b..d74a18a95 100644 --- a/.github/workflows/apps_automated_android.yml +++ b/.github/workflows/apps_automated_android.yml @@ -1,4 +1,7 @@ name: 'apps/automated/android' +permissions: + contents: read + pull-requests: write on: push: diff --git a/.github/workflows/apps_automated_ios.yml b/.github/workflows/apps_automated_ios.yml index 7a7579761..e726f6c25 100644 --- a/.github/workflows/apps_automated_ios.yml +++ b/.github/workflows/apps_automated_ios.yml @@ -1,4 +1,7 @@ name: 'apps/automated/ios' +permissions: + contents: read + pull-requests: write on: push: @@ -51,8 +54,8 @@ jobs: - name: Start iOS Simulator uses: futureware-tech/simulator-action@v4 with: - model: 'iPhone 15' - os_version: '17.5' + model: 'iPhone 16 Pro' + os_version: '18.4' - name: Run tests on iOS Simulator run: npx nx test apps-automated -c=ios diff --git a/.github/workflows/npm_release_core.yml b/.github/workflows/npm_release_core.yml index dfaa67aca..6c7e8bea4 100644 --- a/.github/workflows/npm_release_core.yml +++ b/.github/workflows/npm_release_core.yml @@ -1,4 +1,7 @@ name: '@nativescript/core -> npm' +permissions: + contents: read + pull-requests: write on: push: diff --git a/.github/workflows/npm_release_tns_core.yml b/.github/workflows/npm_release_tns_core.yml index e8dc19060..d4551f046 100644 --- a/.github/workflows/npm_release_tns_core.yml +++ b/.github/workflows/npm_release_tns_core.yml @@ -1,4 +1,7 @@ name: 'tns-core-modules -> npm' +permissions: + contents: read + pull-requests: write on: push: diff --git a/.github/workflows/npm_release_types.yml b/.github/workflows/npm_release_types.yml index 440df76ad..3fe4e8f69 100644 --- a/.github/workflows/npm_release_types.yml +++ b/.github/workflows/npm_release_types.yml @@ -1,5 +1,8 @@ # TODO: modify to build android & ios types first and then merge into types name: '@nativescript/types -> npm' +permissions: + contents: read + pull-requests: write on: push: diff --git a/.github/workflows/npm_release_webpack.yml b/.github/workflows/npm_release_webpack.yml index 392b8b02c..85c0820e0 100644 --- a/.github/workflows/npm_release_webpack.yml +++ b/.github/workflows/npm_release_webpack.yml @@ -1,4 +1,7 @@ name: '@nativescript/webpack -> npm' +permissions: + contents: read + pull-requests: write on: push: diff --git a/apps/automated/src/ui/image/image-tests.ts b/apps/automated/src/ui/image/image-tests.ts index 0ea34140c..9be0666b9 100644 --- a/apps/automated/src/ui/image/image-tests.ts +++ b/apps/automated/src/ui/image/image-tests.ts @@ -1,7 +1,7 @@ import { Image } from '@nativescript/core/ui/image'; import { StackLayout } from '@nativescript/core/ui/layouts/stack-layout'; import { GridLayout } from '@nativescript/core/ui/layouts/grid-layout'; -import { PropertyChangeData } from '@nativescript/core'; +import { PropertyChangeData, Utils } from '@nativescript/core'; import * as utils from '@nativescript/core/utils'; import * as TKUnit from '../../tk-unit'; import { getColor } from '../../ui-helper'; @@ -27,6 +27,8 @@ if (global.isAndroid) { (backgroundModule).initImageCache(Application.android.startActivity, (backgroundModule).CacheMode.memory); // use memory cache only. } +const expectLayoutRequest = __APPLE__ && Utils.SDK_VERSION >= 18; + export const test_Image_Members = function () { const image = new ImageModule.Image(); TKUnit.assert(types.isUndefined(image.src), 'Image.src is defined'); @@ -273,7 +275,11 @@ export const test_SettingImageSourceWhenSizedToParentDoesNotRequestLayout = ios( image.requestLayout = () => (called = true); image.src = '~/assets/logo.png'; - TKUnit.assertFalse(called, 'image.requestLayout should not be called.'); + if (expectLayoutRequest) { + TKUnit.assertTrue(called, 'image.requestLayout should be called.'); + } else { + TKUnit.assertFalse(called, 'image.requestLayout should not be called.'); + } }); export const test_SettingImageSourceWhenFixedWidthAndHeightDoesNotRequestLayout = ios(() => { @@ -291,7 +297,11 @@ export const test_SettingImageSourceWhenFixedWidthAndHeightDoesNotRequestLayout image.requestLayout = () => (called = true); image.src = '~/assets/logo.png'; - TKUnit.assertFalse(called, 'image.requestLayout should not be called.'); + if (expectLayoutRequest) { + TKUnit.assertTrue(called, 'image.requestLayout should be called.'); + } else { + TKUnit.assertFalse(called, 'image.requestLayout should not be called.'); + } }); export const test_SettingImageSourceWhenSizedToContentShouldInvalidate = ios(() => { diff --git a/apps/automated/src/ui/label/label-tests.ts b/apps/automated/src/ui/label/label-tests.ts index 72648865f..92311ab24 100644 --- a/apps/automated/src/ui/label/label-tests.ts +++ b/apps/automated/src/ui/label/label-tests.ts @@ -10,7 +10,7 @@ import * as colorModule from '@nativescript/core/color'; import * as utils from '@nativescript/core/utils'; import * as observableModule from '@nativescript/core/data/observable'; import * as bindable from '@nativescript/core/ui/core/bindable'; -import { CoreTypes, Span, FormattedString } from '@nativescript/core'; +import { CoreTypes, Span, FormattedString, Utils } from '@nativescript/core'; import * as labelTestsNative from './label-tests-native'; import * as fs from '@nativescript/core/file-system'; @@ -23,6 +23,8 @@ import * as helper from '../../ui-helper'; const testDir = 'ui/label'; +const expectLayoutRequest = __APPLE__ && Utils.SDK_VERSION >= 18; + export class LabelTest extends testModule.UITest { public create(): LabelModule.Label { const label = new LabelModule.Label(); @@ -633,7 +635,7 @@ export class LabelTest extends testModule.UITest { } public test_SettingTextWhenInFixedSizeGridShouldNotRequestLayout() { - this.requestLayoutFixture(false, '', (label) => { + this.requestLayoutFixture(expectLayoutRequest, '', (label) => { label.textWrap = false; let host = new GridLayout(); host.width = 100; @@ -644,7 +646,7 @@ export class LabelTest extends testModule.UITest { } public test_ChangingTextWhenInFixedSizeGridShouldNotRequestLayout() { - this.requestLayoutFixture(false, 'Hello World', (label) => { + this.requestLayoutFixture(expectLayoutRequest, 'Hello World', (label) => { label.textWrap = false; let host = new GridLayout(); host.width = 100; @@ -655,7 +657,7 @@ export class LabelTest extends testModule.UITest { } public test_SettingTextWhenFixedWidthAndHeightDoesNotRequestLayout() { - this.requestLayoutFixture(false, '', (label) => { + this.requestLayoutFixture(expectLayoutRequest, '', (label) => { label.textWrap = false; let host = new StackLayout(); label.width = 100; @@ -666,7 +668,7 @@ export class LabelTest extends testModule.UITest { } public test_ChangingTextWhenFixedWidthAndHeightDoesNotRequestLayout() { - this.requestLayoutFixture(false, 'Hello World', (label) => { + this.requestLayoutFixture(expectLayoutRequest, 'Hello World', (label) => { label.textWrap = false; let host = new StackLayout(); label.width = 100; @@ -707,7 +709,7 @@ export class LabelTest extends testModule.UITest { } public test_ChangingTextOnSingleLineTextWhenWidthIsSizedToParentAndHeightIsSizedToContentShouldNotRequestLayout() { - this.requestLayoutFixture(false, 'Hello World', (label) => { + this.requestLayoutFixture(expectLayoutRequest, 'Hello World', (label) => { label.textWrap = false; let host = new StackLayout(); host.width = 100; diff --git a/apps/automated/src/ui/layouts/flexbox-layout-tests.ts b/apps/automated/src/ui/layouts/flexbox-layout-tests.ts index 1fd3ba665..3bbe457cd 100644 --- a/apps/automated/src/ui/layouts/flexbox-layout-tests.ts +++ b/apps/automated/src/ui/layouts/flexbox-layout-tests.ts @@ -116,7 +116,7 @@ let activity_flex_wrap = () =>