Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ios): support for a11y font scale (#10207)
- Loading branch information
Showing
6 changed files
with
50 additions
and
33 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
apps/automated/src/ui/styling/style-properties-tests.ios.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as TKUnit from '../../tk-unit'; | ||
import * as helper from '../../ui-helper'; | ||
import { Label } from '@nativescript/core'; | ||
|
||
export function test_native_font_size_with_a11y_font_scale() { | ||
const page = helper.getCurrentPage(); | ||
const testView = new Label(); | ||
const deviceFontScaleMock = 4.0; | ||
|
||
page.content = testView; | ||
|
||
testView.style._fontScale = 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'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters