feat(breaking): rename ByPlaceholder to ByPlaceholderText (#455)

This commit is contained in:
Michał Pierzchała
2020-07-24 22:53:34 +02:00
parent 7feab6c6da
commit 6d63a4f29e
15 changed files with 158 additions and 102 deletions
+25 -22
View File
@@ -35,8 +35,8 @@ const tree = render(<TestComponent />);
const getBy: ReactTestInstance[] = [
tree.getByText('<View />'),
tree.getByText(/View/g),
tree.getByPlaceholder('my placeholder'),
tree.getByPlaceholder(/placeholder/g),
tree.getByPlaceholderText('my placeholder'),
tree.getByPlaceholderText(/placeholder/g),
tree.getByDisplayValue('my value'),
tree.getByDisplayValue(/value/g),
tree.getByTestId('test-id'),
@@ -58,8 +58,8 @@ const getBy: ReactTestInstance[] = [
const getAllBy: ReactTestInstance[][] = [
tree.getAllByText('<View />'),
tree.getAllByText(/Text/g),
tree.getAllByPlaceholder('my placeholder'),
tree.getAllByPlaceholder(/placeholder/g),
tree.getAllByPlaceholderText('my placeholder'),
tree.getAllByPlaceholderText(/placeholder/g),
tree.getAllByDisplayValue('my value'),
tree.getAllByDisplayValue(/value/g),
tree.getAllByTestId('test-id'),
@@ -82,8 +82,8 @@ const getAllBy: ReactTestInstance[][] = [
const queryBy: Array<ReactTestInstance | null> = [
tree.queryByText('View'),
tree.queryByText(/View/g),
tree.queryByPlaceholder('my placeholder'),
tree.queryByPlaceholder(/placeholder/g),
tree.queryByPlaceholderText('my placeholder'),
tree.queryByPlaceholderText(/placeholder/g),
tree.queryByDisplayValue('my value'),
tree.queryByDisplayValue(/value/g),
tree.queryByTestId('test-id'),
@@ -105,8 +105,8 @@ const queryBy: Array<ReactTestInstance | null> = [
const queryAllBy: ReactTestInstance[][] = [
tree.queryAllByText('View'),
tree.queryAllByText(/View/g),
tree.queryAllByPlaceholder('my placeholder'),
tree.queryAllByPlaceholder(/placeholder/g),
tree.queryAllByPlaceholderText('my placeholder'),
tree.queryAllByPlaceholderText(/placeholder/g),
tree.queryAllByDisplayValue('my value'),
tree.queryAllByDisplayValue(/value/g),
tree.queryAllByTestId('test-id'),
@@ -131,10 +131,10 @@ const findBy: Promise<ReactTestInstance>[] = [
tree.findByText('View', { timeout: 10, interval: 10 }),
tree.findByText(/View/g),
tree.findByText(/View/g, { timeout: 10, interval: 5 }),
tree.findByPlaceholder('my placeholder'),
tree.findByPlaceholder('my placeholder', { timeout: 10, interval: 5 }),
tree.findByPlaceholder(/placeholder/g),
tree.findByPlaceholder(/placeholder/g, { timeout: 10, interval: 5 }),
tree.findByPlaceholderText('my placeholder'),
tree.findByPlaceholderText('my placeholder', { timeout: 10, interval: 5 }),
tree.findByPlaceholderText(/placeholder/g),
tree.findByPlaceholderText(/placeholder/g, { timeout: 10, interval: 5 }),
tree.findByDisplayValue('my value'),
tree.findByDisplayValue('my value', { timeout: 10, interval: 10 }),
tree.findByDisplayValue(/value/g),
@@ -164,10 +164,13 @@ const findAllBy: Promise<ReactTestInstance[]>[] = [
tree.findAllByText('View', { timeout: 10, interval: 10 }),
tree.findAllByText(/View/g),
tree.findAllByText(/View/g, { timeout: 10, interval: 5 }),
tree.findAllByPlaceholder('my placeholder'),
tree.findAllByPlaceholder('my placeholder', { timeout: 10, interval: 10 }),
tree.findAllByPlaceholder(/placeholder/g),
tree.findAllByPlaceholder(/placeholder/g, { timeout: 10, interval: 10 }),
tree.findAllByPlaceholderText('my placeholder'),
tree.findAllByPlaceholderText('my placeholder', {
timeout: 10,
interval: 10,
}),
tree.findAllByPlaceholderText(/placeholder/g),
tree.findAllByPlaceholderText(/placeholder/g, { timeout: 10, interval: 10 }),
tree.findAllByDisplayValue('View'),
tree.findAllByDisplayValue('View', { timeout: 10, interval: 10 }),
tree.findAllByDisplayValue(/View/g),
@@ -293,7 +296,7 @@ const instance: ReactTestInstance = tree.getByText('<View />');
const withinGet: Array<ReactTestInstance> = [
within(instance).getByText('Test'),
within(instance).getByDisplayValue('Test'),
within(instance).getByPlaceholder('Test'),
within(instance).getByPlaceholderText('Test'),
within(instance).getByTestId('Test'),
within(instance).getByA11yLabel('Test'),
within(instance).getByLabelText('Test'),
@@ -308,7 +311,7 @@ const withinGet: Array<ReactTestInstance> = [
const withinGetAll: Array<ReactTestInstance[]> = [
within(instance).getAllByText('Test'),
within(instance).getAllByDisplayValue('Test'),
within(instance).getAllByPlaceholder('Test'),
within(instance).getAllByPlaceholderText('Test'),
within(instance).getAllByTestId('Test'),
within(instance).getAllByA11yLabel('Test'),
within(instance).getAllByLabelText('button'),
@@ -323,7 +326,7 @@ const withinGetAll: Array<ReactTestInstance[]> = [
const withinQuery: Array<ReactTestInstance | null> = [
within(instance).queryByText('Test'),
within(instance).queryByDisplayValue('Test'),
within(instance).queryByPlaceholder('Test'),
within(instance).queryByPlaceholderText('Test'),
within(instance).queryByTestId('Test'),
within(instance).queryByA11yLabel('Test'),
within(instance).queryByLabelText('button'),
@@ -338,7 +341,7 @@ const withinQuery: Array<ReactTestInstance | null> = [
const withinQueryAll: Array<ReactTestInstance[]> = [
within(instance).queryAllByText('Test'),
within(instance).queryAllByDisplayValue('Test'),
within(instance).queryAllByPlaceholder('Test'),
within(instance).queryAllByPlaceholderText('Test'),
within(instance).queryAllByTestId('Test'),
within(instance).queryAllByA11yLabel('Test'),
within(instance).queryAllByLabelText('Test'),
@@ -353,7 +356,7 @@ const withinQueryAll: Array<ReactTestInstance[]> = [
const withinFind: Promise<ReactTestInstance>[] = [
within(instance).findByText('Test'),
within(instance).findByDisplayValue('Test'),
within(instance).findByPlaceholder('Test'),
within(instance).findByPlaceholderText('Test'),
within(instance).findByTestId('Test'),
within(instance).findByA11yLabel('Test'),
within(instance).findByLabelText('Test'),
@@ -368,7 +371,7 @@ const withinFind: Promise<ReactTestInstance>[] = [
const withinFindAll: Promise<ReactTestInstance[]>[] = [
within(instance).findAllByText('Test'),
within(instance).findAllByDisplayValue('Test'),
within(instance).findAllByPlaceholder('Test'),
within(instance).findAllByPlaceholderText('Test'),
within(instance).findAllByTestId('Test'),
within(instance).findAllByA11yLabel('Test'),
within(instance).findAllByLabelText('Test'),