ronantakizawa/codereview-bench huggingface dataset:
Repository: NativeScript/NativeScript
File: apps/automated/src/accessibility/accessibility-properties-tests.ts (TypeScript)

Code before:
		testView.style.iOSAccessibilityMinFontScale = 2.0;

		const nativeFontSize = testView.nativeTextViewProtected.font.pointSize;
		const expectedNativeFontSize = testView.style.fontInternal.fontSize * testView.style.iOSAccessibilityMinFontScale;
		TKUnit.assertEqual(nativeFontSize, expectedNativeFontSize, 'View font size scaling does not respect iOSAccessibilityMinFontScale');
	}
}

export function test_iOSAccessibilityMaxFontScale_property() {
	if (isIOS) {
		const deviceFontScaleMock = 4.0;

		const page = helper.getCurrentPage();
		const testView = new Label();
		const layout = new StackLayout();
		layout.addChild(testView);

		page.content = layout;

		layout.style.iOSAccessibilityAdjustsFontSize = true;
		layout.style.fontScaleInternal = deviceFontScaleMock;

		testView.style.iOSAccessibilityMaxFontScale = 2.0;

		const nativeFontSize = testView.nativeTextViewProtected.font.pointSize;
		const expectedNativeFontSize = testView.style.fontInternal.fontSize * testView.style.iOSAccessibilityMaxFontScale;
		TKUnit.assertEqual(nativeFontSize, expectedNativeFontSize, 'View font size scaling does not respect iOSAccessibilityMaxFontScale');
	}
}


Review comment (suggestion):
```suggestion
		const expectedNativeFontSize = testView.style.fontInternal.fontSize * testView.style.iosAccessibilityMaxFontScale;
```

Code after:
		testView.style.iosAccessibilityMinFontScale = 2.0;

		const nativeFontSize = testView.nativeTextViewProtected.font.pointSize;
		const expectedNativeFontSize = testView.style.fontInternal.fontSize * testView.style.iosAccessibilityMinFontScale;
		TKUnit.assertEqual(nativeFontSize, expectedNativeFontSize, 'View font size scaling does not respect iosAccessibilityMinFontScale');
	}
}

export function test_iosAccessibilityMaxFontScale_property() {
	if (isIOS) {
		const deviceFontScaleMock = 4.0;

		const page = helper.getCurrentPage();
		const testView = new Label();
		const layout = new StackLayout();
		layout.addChild(testView);

		page.content = layout;

		layout.style.iosAccessibilityAdjustsFontSize = true;
		layout.style.fontScaleInternal = deviceFontScaleMock;

		testView.style.iosAccessibilityMaxFontScale = 2.0;

		const nativeFontSize = testView.nativeTextViewProtected.font.pointSize;
		const expectedNativeFontSize = testView.style.fontInternal.fontSize * testView.style.iosAccessibilityMaxFontScale;
		TKUnit.assertEqual(nativeFontSize, expectedNativeFontSize, 'View font size scaling does not respect iosAccessibilityMaxFontScale');
	}
}
Repository: NativeScript/NativeScript
File: apps/automated/src/accessibility/accessibility-properties-tests.ts (TypeScript)

Code before:
		layout.style.iOSAccessibilityAdjustsFontSize = true;
		layout.style.fontScaleInternal = deviceFontScaleMock;

		testView.style.iOSAccessibilityMinFontScale = 2.0;

		const nativeFontSize = testView.nativeTextViewProtected.font.pointSize;
		const expectedNativeFontSize = testView.style.fontInternal.fontSize * testView.style.iOSAccessibilityMinFontScale;
		TKUnit.assertEqual(nativeFontSize, expectedNativeFontSize, 'View font size scaling does not respect iOSAccessibilityMinFontScale');
	}
}

export function test_iOSAccessibilityMaxFontScale_property() {
	if (isIOS) {
		const deviceFontScaleMock = 4.0;

		const page = helper.getCurrentPage();
		const testView = new Label();
		const layout = new StackLayout();
		layout.addChild(testView);

		page.content = layout;

		layout.style.iOSAccessibilityAdjustsFontSize = true;
		layout.style.fontScaleInternal = deviceFontScaleMock;

		testView.style.iOSAccessibilityMaxFontScale = 2.0;

		const nativeFontSize = testView.nativeTextViewProtected.font.pointSize;
		const expectedNativeFontSize = testView.style.fontInternal.fontSize * testView.style.iOSAccessibilityMaxFontScale;
		TKUnit.assertEqual(nativeFontSize, expectedNativeFontSize, 'View font size scaling does not respect iOSAccessibilityMaxFontScale');
	}
}


Review comment (suggestion):
```suggestion
		testView.style.iosAccessibilityMaxFontScale = 2.0;
```

Code after:
		layout.style.iosAccessibilityAdjustsFontSize = true;
		layout.style.fontScaleInternal = deviceFontScaleMock;

		testView.style.iosAccessibilityMinFontScale = 2.0;

		const nativeFontSize = testView.nativeTextViewProtected.font.pointSize;
		const expectedNativeFontSize = testView.style.fontInternal.fontSize * testView.style.iosAccessibilityMinFontScale;
		TKUnit.assertEqual(nativeFontSize, expectedNativeFontSize, 'View font size scaling does not respect iosAccessibilityMinFontScale');
	}
}

export function test_iosAccessibilityMaxFontScale_property() {
	if (isIOS) {
		const deviceFontScaleMock = 4.0;

		const page = helper.getCurrentPage();
		const testView = new Label();
		const layout = new StackLayout();
		layout.addChild(testView);

		page.content = layout;

		layout.style.iosAccessibilityAdjustsFontSize = true;
		layout.style.fontScaleInternal = deviceFontScaleMock;

		testView.style.iosAccessibilityMaxFontScale = 2.0;

		const nativeFontSize = testView.nativeTextViewProtected.font.pointSize;
		const expectedNativeFontSize = testView.style.fontInternal.fontSize * testView.style.iosAccessibilityMaxFontScale;
		TKUnit.assertEqual(nativeFontSize, expectedNativeFontSize, 'View font size scaling does not respect iosAccessibilityMaxFontScale');
	}
}
Repository: NativeScript/NativeScript
File: apps/automated/src/accessibility/accessibility-properties-tests.ts (TypeScript)

Code before:

		page.content = layout;

		layout.style.iOSAccessibilityAdjustsFontSize = true;
		layout.style.fontScaleInternal = deviceFontScaleMock;

		testView.style.iOSAccessibilityMinFontScale = 2.0;

		const nativeFontSize = testView.nativeTextViewProtected.font.pointSize;
		const expectedNativeFontSize = testView.style.fontInternal.fontSize * testView.style.iOSAccessibilityMinFontScale;
		TKUnit.assertEqual(nativeFontSize, expectedNativeFontSize, 'View font size scaling does not respect iOSAccessibilityMinFontScale');
	}
}

export function test_iOSAccessibilityMaxFontScale_property() {
	if (isIOS) {
		const deviceFontScaleMock = 4.0;

		const page = helper.getCurrentPage();
		const testView = new Label();
		const layout = new StackLayout();
		layout.addChild(testView);

		page.content = layout;

		layout.style.iOSAccessibilityAdjustsFontSize = true;
		layout.style.fontScaleInternal = deviceFontScaleMock;

		testView.style.iOSAccessibilityMaxFontScale = 2.0;

		const nativeFontSize = testView.nativeTextViewProtected.font.pointSize;
		const expectedNativeFontSize = testView.style.fontInternal.fontSize * testView.style.iOSAccessibilityMaxFontScale;
		TKUnit.assertEqual(nativeFontSize, expectedNativeFontSize, 'View font size scaling does not respect iOSAccessibilityMaxFontScale');
	}
}


Review comment (suggestion):
```suggestion
		layout.style.iosAccessibilityAdjustsFontSize = true;
```

Code after:

		page.content = layout;

		layout.style.iosAccessibilityAdjustsFontSize = true;
		layout.style.fontScaleInternal = deviceFontScaleMock;

		testView.style.iosAccessibilityMinFontScale = 2.0;

		const nativeFontSize = testView.nativeTextViewProtected.font.pointSize;
		const expectedNativeFontSize = testView.style.fontInternal.fontSize * testView.style.iosAccessibilityMinFontScale;
		TKUnit.assertEqual(nativeFontSize, expectedNativeFontSize, 'View font size scaling does not respect iosAccessibilityMinFontScale');
	}
}

export function test_iosAccessibilityMaxFontScale_property() {
	if (isIOS) {
		const deviceFontScaleMock = 4.0;

		const page = helper.getCurrentPage();
		const testView = new Label();
		const layout = new StackLayout();
		layout.addChild(testView);

		page.content = layout;

		layout.style.iosAccessibilityAdjustsFontSize = true;
		layout.style.fontScaleInternal = deviceFontScaleMock;

		testView.style.iosAccessibilityMaxFontScale = 2.0;

		const nativeFontSize = testView.nativeTextViewProtected.font.pointSize;
		const expectedNativeFontSize = testView.style.fontInternal.fontSize * testView.style.iosAccessibilityMaxFontScale;
		TKUnit.assertEqual(nativeFontSize, expectedNativeFontSize, 'View font size scaling does not respect iosAccessibilityMaxFontScale');
	}
}
Repository: NativeScript/NativeScript
File: apps/automated/src/accessibility/accessibility-properties-tests.ts (TypeScript)

Code before:
import * as TKUnit from '../tk-unit';
import * as helper from '../ui-helper';
import { isIOS, Label, StackLayout } from '@nativescript/core';

export function test_iOSAccessibilityAdjustsFontSize_property() {
	if (isIOS) {
		const deviceFontScaleMock = 4.0;

		const page = helper.getCurrentPage();
		const testView = new Label();
		const layout = new StackLayout();
		layout.addChild(testView);

		page.content = layout;

		layout.style.iOSAccessibilityAdjustsFontSize = false;
		layout.style.fontScaleInternal = deviceFontScaleMock;

		const nativeFontSize = testView.nativeTextViewProtected.font.pointSize;
		layout.style.iOSAccessibilityAdjustsFontSize = true;
		const nativeFontSizeWithAdjust = testView.nativeTextViewProtected.font.pointSize;

		TKUnit.assertEqual(nativeFontSize, testView.style.fontInternal.fontSize, 'View font size was scaled even though iOSAccessibilityAdjustsFontSize is disabled');
		TKUnit.assertEqual(nativeFontSizeWithAdjust, testView.style.fontInternal.fontSize * deviceFontScaleMock, 'View font size was not scaled even though iOSAccessibilityAdjustsFontSize is enabled');
	}
}

export function test_iOSAccessibilityMinFontScale_property() {
	if (isIOS) {
		const deviceFontScaleMock = 1.0;

Review comment (suggestion):
```suggestion
export function test_iosAccessibilityAdjustsFontSize_property() {
```

Code after:
import * as TKUnit from '../tk-unit';
import * as helper from '../ui-helper';
import { isIOS, Label, StackLayout } from '@nativescript/core';

export function test_iosAccessibilityAdjustsFontSize_property() {
	if (isIOS) {
		const deviceFontScaleMock = 4.0;

		const page = helper.getCurrentPage();
		const testView = new Label();
		const layout = new StackLayout();
		layout.addChild(testView);

		page.content = layout;

		layout.style.iosAccessibilityAdjustsFontSize = false;
		layout.style.fontScaleInternal = deviceFontScaleMock;

		const nativeFontSize = testView.nativeTextViewProtected.font.pointSize;
		layout.style.iosAccessibilityAdjustsFontSize = true;
		const nativeFontSizeWithAdjust = testView.nativeTextViewProtected.font.pointSize;

		TKUnit.assertEqual(nativeFontSize, testView.style.fontInternal.fontSize, 'View font size was scaled even though iosAccessibilityAdjustsFontSize is disabled');
		TKUnit.assertEqual(nativeFontSizeWithAdjust, testView.style.fontInternal.fontSize * deviceFontScaleMock, 'View font size was not scaled even though iosAccessibilityAdjustsFontSize is enabled');
	}
}

export function test_iosAccessibilityMinFontScale_property() {
	if (isIOS) {
		const deviceFontScaleMock = 1.0;
Repository: NativeScript/NativeScript
File: apps/automated/src/accessibility/accessibility-properties-tests.ts (TypeScript)

Code before:

		const nativeFontSize = testView.nativeTextViewProtected.font.pointSize;
		const expectedNativeFontSize = testView.style.fontInternal.fontSize * testView.style.iOSAccessibilityMinFontScale;
		TKUnit.assertEqual(nativeFontSize, expectedNativeFontSize, 'View font size scaling does not respect iOSAccessibilityMinFontScale');
	}
}

export function test_iOSAccessibilityMaxFontScale_property() {
	if (isIOS) {
		const deviceFontScaleMock = 4.0;

		const page = helper.getCurrentPage();
		const testView = new Label();
		const layout = new StackLayout();
		layout.addChild(testView);

		page.content = layout;

		layout.style.iOSAccessibilityAdjustsFontSize = true;
		layout.style.fontScaleInternal = deviceFontScaleMock;

		testView.style.iOSAccessibilityMaxFontScale = 2.0;

		const nativeFontSize = testView.nativeTextViewProtected.font.pointSize;
		const expectedNativeFontSize = testView.style.fontInternal.fontSize * testView.style.iOSAccessibilityMaxFontScale;
		TKUnit.assertEqual(nativeFontSize, expectedNativeFontSize, 'View font size scaling does not respect iOSAccessibilityMaxFontScale');
	}
}


Review comment (suggestion):
```suggestion
		TKUnit.assertEqual(nativeFontSize, expectedNativeFontSize, 'View font size scaling does not respect iosAccessibilityMaxFontScale');
```

Code after:

		const nativeFontSize = testView.nativeTextViewProtected.font.pointSize;
		const expectedNativeFontSize = testView.style.fontInternal.fontSize * testView.style.iosAccessibilityMinFontScale;
		TKUnit.assertEqual(nativeFontSize, expectedNativeFontSize, 'View font size scaling does not respect iosAccessibilityMinFontScale');
	}
}

export function test_iosAccessibilityMaxFontScale_property() {
	if (isIOS) {
		const deviceFontScaleMock = 4.0;

		const page = helper.getCurrentPage();
		const testView = new Label();
		const layout = new StackLayout();
		layout.addChild(testView);

		page.content = layout;

		layout.style.iosAccessibilityAdjustsFontSize = true;
		layout.style.fontScaleInternal = deviceFontScaleMock;

		testView.style.iosAccessibilityMaxFontScale = 2.0;

		const nativeFontSize = testView.nativeTextViewProtected.font.pointSize;
		const expectedNativeFontSize = testView.style.fontInternal.fontSize * testView.style.iosAccessibilityMaxFontScale;
		TKUnit.assertEqual(nativeFontSize, expectedNativeFontSize, 'View font size scaling does not respect iosAccessibilityMaxFontScale');
	}
}
Repository: NativeScript/NativeScript
File: packages/core/ui/core/view/index.d.ts (TypeScript)

Code before:
	/**
	 * Current value of the element in a localized string.
	 */
	accessibilityValue: string;

	/**
	 * A hint describes the elements behavior. Example: 'Tap change playback speed'
	 */
	accessibilityHint: string;
	accessibilityLiveRegion: AccessibilityLiveRegion;

	/**
	 * Sets the language in which to speak the element's label and value.
	 * Accepts language ID tags that follows the "BCP 47" specification.
	 */
	accessibilityLanguage: string;

	/**
	 * This view starts a media session. Equivalent to trait = startsMedia
	 */
	accessibilityMediaSession: boolean;

	/**
	 * Defines whether accessibility font scale should affect font size.
	 */
	iOSAccessibilityAdjustsFontSize: boolean;

	/**
	 * Gets or sets the minimum accessibility font scale.
	 */
	iOSAccessibilityMinFontScale: number;

	/**
	 * Gets or sets the maximum accessibility font scale.
	 */
	iOSAccessibilityMaxFontScale: number;

	/**
	 * Internal use only. This is used to limit the number of updates to android.view.View.setContentDescription()
	 */
	_androidContentDescriptionUpdated?: boolean;

	automationText: string;

	/**
	 * Gets or sets the elevation of the android view.
	 */
	androidElevation: number;

	/**
	 * Gets or sets the dynamic elevation offset of the android view.

Review comment (suggestion):
```suggestion
	iosAccessibilityAdjustsFontSize: boolean;
```

Code after:
	/**
	 * Current value of the element in a localized string.
	 */
	accessibilityValue: string;

	/**
	 * A hint describes the elements behavior. Example: 'Tap change playback speed'
	 */
	accessibilityHint: string;
	accessibilityLiveRegion: AccessibilityLiveRegion;

	/**
	 * Sets the language in which to speak the element's label and value.
	 * Accepts language ID tags that follows the "BCP 47" specification.
	 */
	accessibilityLanguage: string;

	/**
	 * This view starts a media session. Equivalent to trait = startsMedia
	 */
	accessibilityMediaSession: boolean;

	/**
	 * Defines whether accessibility font scale should affect font size.
	 */
	iosAccessibilityAdjustsFontSize: boolean;

	/**
	 * Gets or sets the minimum accessibility font scale.
	 */
	iosAccessibilityMinFontScale: number;

	/**
	 * Gets or sets the maximum accessibility font scale.
	 */
	iosAccessibilityMaxFontScale: number;

	/**
	 * Internal use only. This is used to limit the number of updates to android.view.View.setContentDescription()
	 */
	_androidContentDescriptionUpdated?: boolean;

	automationText: string;

	/**
	 * Gets or sets the elevation of the android view.
	 */
	androidElevation: number;

	/**
	 * Gets or sets the dynamic elevation offset of the android view.
Repository: NativeScript/NativeScript
File: packages/core/ui/core/view/index.d.ts (TypeScript)

Code before:
	/**
	 * A hint describes the elements behavior. Example: 'Tap change playback speed'
	 */
	accessibilityHint: string;
	accessibilityLiveRegion: AccessibilityLiveRegion;

	/**
	 * Sets the language in which to speak the element's label and value.
	 * Accepts language ID tags that follows the "BCP 47" specification.
	 */
	accessibilityLanguage: string;

	/**
	 * This view starts a media session. Equivalent to trait = startsMedia
	 */
	accessibilityMediaSession: boolean;

	/**
	 * Defines whether accessibility font scale should affect font size.
	 */
	iOSAccessibilityAdjustsFontSize: boolean;

	/**
	 * Gets or sets the minimum accessibility font scale.
	 */
	iOSAccessibilityMinFontScale: number;

	/**
	 * Gets or sets the maximum accessibility font scale.
	 */
	iOSAccessibilityMaxFontScale: number;

	/**
	 * Internal use only. This is used to limit the number of updates to android.view.View.setContentDescription()
	 */
	_androidContentDescriptionUpdated?: boolean;

	automationText: string;

	/**
	 * Gets or sets the elevation of the android view.
	 */
	androidElevation: number;

	/**
	 * Gets or sets the dynamic elevation offset of the android view.
	 */
	androidDynamicElevationOffset: number;

	/**
	 * Gets or sets the background style property.

Review comment (suggestion):
```suggestion
	iosAccessibilityMinFontScale: number;
```

Code after:
	/**
	 * A hint describes the elements behavior. Example: 'Tap change playback speed'
	 */
	accessibilityHint: string;
	accessibilityLiveRegion: AccessibilityLiveRegion;

	/**
	 * Sets the language in which to speak the element's label and value.
	 * Accepts language ID tags that follows the "BCP 47" specification.
	 */
	accessibilityLanguage: string;

	/**
	 * This view starts a media session. Equivalent to trait = startsMedia
	 */
	accessibilityMediaSession: boolean;

	/**
	 * Defines whether accessibility font scale should affect font size.
	 */
	iosAccessibilityAdjustsFontSize: boolean;

	/**
	 * Gets or sets the minimum accessibility font scale.
	 */
	iosAccessibilityMinFontScale: number;

	/**
	 * Gets or sets the maximum accessibility font scale.
	 */
	iosAccessibilityMaxFontScale: number;

	/**
	 * Internal use only. This is used to limit the number of updates to android.view.View.setContentDescription()
	 */
	_androidContentDescriptionUpdated?: boolean;

	automationText: string;

	/**
	 * Gets or sets the elevation of the android view.
	 */
	androidElevation: number;

	/**
	 * Gets or sets the dynamic elevation offset of the android view.
	 */
	androidDynamicElevationOffset: number;

	/**
	 * Gets or sets the background style property.
Repository: NativeScript/NativeScript
File: packages/core/ui/core/view/index.d.ts (TypeScript)

Code before:

	/**
	 * Sets the language in which to speak the element's label and value.
	 * Accepts language ID tags that follows the "BCP 47" specification.
	 */
	accessibilityLanguage: string;

	/**
	 * This view starts a media session. Equivalent to trait = startsMedia
	 */
	accessibilityMediaSession: boolean;

	/**
	 * Defines whether accessibility font scale should affect font size.
	 */
	iOSAccessibilityAdjustsFontSize: boolean;

	/**
	 * Gets or sets the minimum accessibility font scale.
	 */
	iOSAccessibilityMinFontScale: number;

	/**
	 * Gets or sets the maximum accessibility font scale.
	 */
	iOSAccessibilityMaxFontScale: number;

	/**
	 * Internal use only. This is used to limit the number of updates to android.view.View.setContentDescription()
	 */
	_androidContentDescriptionUpdated?: boolean;

	automationText: string;

	/**
	 * Gets or sets the elevation of the android view.
	 */
	androidElevation: number;

	/**
	 * Gets or sets the dynamic elevation offset of the android view.
	 */
	androidDynamicElevationOffset: number;

	/**
	 * Gets or sets the background style property.
	 */
	background: string;

	/**
	 * Gets or sets the background color of the view.

Review comment (suggestion):
```suggestion
	iosAccessibilityMaxFontScale: number;
```

Code after:

	/**
	 * Sets the language in which to speak the element's label and value.
	 * Accepts language ID tags that follows the "BCP 47" specification.
	 */
	accessibilityLanguage: string;

	/**
	 * This view starts a media session. Equivalent to trait = startsMedia
	 */
	accessibilityMediaSession: boolean;

	/**
	 * Defines whether accessibility font scale should affect font size.
	 */
	iosAccessibilityAdjustsFontSize: boolean;

	/**
	 * Gets or sets the minimum accessibility font scale.
	 */
	iosAccessibilityMinFontScale: number;

	/**
	 * Gets or sets the maximum accessibility font scale.
	 */
	iosAccessibilityMaxFontScale: number;

	/**
	 * Internal use only. This is used to limit the number of updates to android.view.View.setContentDescription()
	 */
	_androidContentDescriptionUpdated?: boolean;

	automationText: string;

	/**
	 * Gets or sets the elevation of the android view.
	 */
	androidElevation: number;

	/**
	 * Gets or sets the dynamic elevation offset of the android view.
	 */
	androidDynamicElevationOffset: number;

	/**
	 * Gets or sets the background style property.
	 */
	background: string;

	/**
	 * Gets or sets the background color of the view.