Skip to content

Change test naming and reordered tests #2911

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 26 additions & 31 deletions src/components/text/__tests__/index.driver.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,41 +50,36 @@ describe('Text', () => {
Constants.isRTL = isRTL;
};

describe('Automation gap', () => {
describe('Both RTL and LTR', () => {
it('Should always align text to left on Android', () => {
jest.isolateModules(() => {
setConstants(true, true);
const {textDriver} = getDriver();
const textStyle = textDriver.getProps().style;
expect(StyleSheet.flatten(textStyle).textAlign).toEqual('left');
});
jest.isolateModules(() => {
setConstants(true, false);
const {textDriver} = getDriver();
const textStyle = textDriver.getProps().style;
expect(StyleSheet.flatten(textStyle).textAlign).toEqual('left');
});
describe('Text alignment', () => {
it('Should always align text to left on Android (LTR/RTL)', () => {
jest.isolateModules(() => {
setConstants(true, true);
const {textDriver} = getDriver();
const textStyle = textDriver.getProps().style;
expect(StyleSheet.flatten(textStyle).textAlign).toEqual('left');
});
jest.isolateModules(() => {
setConstants(true, false);
const {textDriver} = getDriver();
const textStyle = textDriver.getProps().style;
expect(StyleSheet.flatten(textStyle).textAlign).toEqual('left');
});
});
describe('RTL', () => {
it('Should have text of left on iOS', () => {
jest.isolateModules(() => {
setConstants(false, true);
const {textDriver} = getDriver();
const textStyle = textDriver.getProps().style;
expect(StyleSheet.flatten(textStyle).writingDirection).toEqual('rtl');
});

it('Should have text of right on iOS RTL', () => {
jest.isolateModules(() => {
setConstants(false, true);
const {textDriver} = getDriver();
const textStyle = textDriver.getProps().style;
expect(StyleSheet.flatten(textStyle).writingDirection).toEqual('rtl');
});
});
describe('LTR', () => {
it('Should have text of right on iOS', () => {
jest.isolateModules(() => {
setConstants(false, false);
const {textDriver} = getDriver();
const textStyle = textDriver.getProps().style;
expect(StyleSheet.flatten(textStyle).writingDirection).toEqual('ltr');
});
it('Should have text of left on iOS LTR', () => {
jest.isolateModules(() => {
setConstants(false, false);
const {textDriver} = getDriver();
const textStyle = textDriver.getProps().style;
expect(StyleSheet.flatten(textStyle).writingDirection).toEqual('ltr');
});
});
});
Expand Down