Skip to content

Commit c261245

Browse files
authored
Change test naming and reordered tests (#2911)
1 parent 25432ec commit c261245

File tree

1 file changed

+26
-31
lines changed

1 file changed

+26
-31
lines changed

src/components/text/__tests__/index.driver.spec.tsx

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -50,41 +50,36 @@ describe('Text', () => {
5050
Constants.isRTL = isRTL;
5151
};
5252

53-
describe('Automation gap', () => {
54-
describe('Both RTL and LTR', () => {
55-
it('Should always align text to left on Android', () => {
56-
jest.isolateModules(() => {
57-
setConstants(true, true);
58-
const {textDriver} = getDriver();
59-
const textStyle = textDriver.getProps().style;
60-
expect(StyleSheet.flatten(textStyle).textAlign).toEqual('left');
61-
});
62-
jest.isolateModules(() => {
63-
setConstants(true, false);
64-
const {textDriver} = getDriver();
65-
const textStyle = textDriver.getProps().style;
66-
expect(StyleSheet.flatten(textStyle).textAlign).toEqual('left');
67-
});
53+
describe('Text alignment', () => {
54+
it('Should always align text to left on Android (LTR/RTL)', () => {
55+
jest.isolateModules(() => {
56+
setConstants(true, true);
57+
const {textDriver} = getDriver();
58+
const textStyle = textDriver.getProps().style;
59+
expect(StyleSheet.flatten(textStyle).textAlign).toEqual('left');
60+
});
61+
jest.isolateModules(() => {
62+
setConstants(true, false);
63+
const {textDriver} = getDriver();
64+
const textStyle = textDriver.getProps().style;
65+
expect(StyleSheet.flatten(textStyle).textAlign).toEqual('left');
6866
});
6967
});
70-
describe('RTL', () => {
71-
it('Should have text of left on iOS', () => {
72-
jest.isolateModules(() => {
73-
setConstants(false, true);
74-
const {textDriver} = getDriver();
75-
const textStyle = textDriver.getProps().style;
76-
expect(StyleSheet.flatten(textStyle).writingDirection).toEqual('rtl');
77-
});
68+
69+
it('Should have text of right on iOS RTL', () => {
70+
jest.isolateModules(() => {
71+
setConstants(false, true);
72+
const {textDriver} = getDriver();
73+
const textStyle = textDriver.getProps().style;
74+
expect(StyleSheet.flatten(textStyle).writingDirection).toEqual('rtl');
7875
});
7976
});
80-
describe('LTR', () => {
81-
it('Should have text of right on iOS', () => {
82-
jest.isolateModules(() => {
83-
setConstants(false, false);
84-
const {textDriver} = getDriver();
85-
const textStyle = textDriver.getProps().style;
86-
expect(StyleSheet.flatten(textStyle).writingDirection).toEqual('ltr');
87-
});
77+
it('Should have text of left on iOS LTR', () => {
78+
jest.isolateModules(() => {
79+
setConstants(false, false);
80+
const {textDriver} = getDriver();
81+
const textStyle = textDriver.getProps().style;
82+
expect(StyleSheet.flatten(textStyle).writingDirection).toEqual('ltr');
8883
});
8984
});
9085
});

0 commit comments

Comments
 (0)