Repository: NativeScript/NativeScript
File: apps/automated/src/ui/styling/style-properties-tests.ts (TypeScript)

Code before:
	if (global.isIOS) {
		const basePath = 'fonts';
		fontModule.ios.registerFont(basePath + '/Roboto-Regular.ttf');
		fontModule.ios.registerFont(basePath + '/Roboto-Bold.ttf');
		fontModule.ios.registerFont(basePath + '/Roboto-BoldItalic.ttf');
		fontModule.ios.registerFont(basePath + '/Roboto-Italic.ttf');
	}

	test_native_font('normal', 'normal');
	test_native_font('italic', 'normal');
	test_native_font('normal', 'bold');
	test_native_font('italic', 'bold');
}

export function test_native_font_size_with_a11y_font_scale() {
	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;

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

function test_native_font(style: 'normal' | 'italic', weight: '100' | '200' | '300' | 'normal' | '400' | '500' | '600' | 'bold' | '700' | '800' | '900') {
	const testView = new Button();

	const page = helper.getCurrentPage();
	page.content = testView;

	const fontName = 'Roboto';
	let fontNameSuffix = '';

	testView.style.fontFamily = fontName;
	testView.style.fontWeight = weight;
	testView.style.fontStyle = style;

	if (style === 'normal' && weight === 'normal') {
		fontNameSuffix += 'Regular';
	}
	if (weight === 'bold') {

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

Code after:
	if (global.isIOS) {
		const basePath = 'fonts';
		fontModule.ios.registerFont(basePath + '/Roboto-Regular.ttf');
		fontModule.ios.registerFont(basePath + '/Roboto-Bold.ttf');
		fontModule.ios.registerFont(basePath + '/Roboto-BoldItalic.ttf');
		fontModule.ios.registerFont(basePath + '/Roboto-Italic.ttf');
	}

	test_native_font('normal', 'normal');
	test_native_font('italic', 'normal');
	test_native_font('normal', 'bold');
	test_native_font('italic', 'bold');
}

export function test_native_font_size_with_a11y_font_scale() {
	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;

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

function test_native_font(style: 'normal' | 'italic', weight: '100' | '200' | '300' | 'normal' | '400' | '500' | '600' | 'bold' | '700' | '800' | '900') {
	const testView = new Button();

	const page = helper.getCurrentPage();
	page.content = testView;

	const fontName = 'Roboto';
	let fontNameSuffix = '';

	testView.style.fontFamily = fontName;
	testView.style.fontWeight = weight;
	testView.style.fontStyle = style;

	if (style === 'normal' && weight === 'normal') {
		fontNameSuffix += 'Regular';
	}
	if (weight === 'bold') {