Skip to content

Commit a36ed51

Browse files
committed
test: sort queries for consistent comparison
1 parent cdd25d8 commit a36ed51

File tree

1 file changed

+78
-78
lines changed

1 file changed

+78
-78
lines changed

src/__tests__/queries.test.js

Lines changed: 78 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -25,55 +25,55 @@ describe("when @testing-library/dom is not available", () => {
2525
it("uses the default queries", () => {
2626
const { queries } = requireQueries(true);
2727

28-
expect(queries).toStrictEqual([
28+
expect([...queries].sort()).toStrictEqual([
29+
"findAllByAltText",
30+
"findAllByDisplayValue",
2931
"findAllByLabelText",
30-
"findByLabelText",
31-
"getAllByLabelText",
32-
"getByLabelText",
33-
"queryAllByLabelText",
34-
"queryByLabelText",
3532
"findAllByPlaceholderText",
36-
"findByPlaceholderText",
37-
"getAllByPlaceholderText",
38-
"getByPlaceholderText",
39-
"queryAllByPlaceholderText",
40-
"queryByPlaceholderText",
33+
"findAllByRole",
34+
"findAllByTestId",
4135
"findAllByText",
42-
"findByText",
43-
"getAllByText",
44-
"getByText",
45-
"queryAllByText",
46-
"queryByText",
47-
"findAllByDisplayValue",
48-
"findByDisplayValue",
49-
"getAllByDisplayValue",
50-
"getByDisplayValue",
51-
"queryAllByDisplayValue",
52-
"queryByDisplayValue",
53-
"findAllByAltText",
54-
"findByAltText",
55-
"getAllByAltText",
56-
"getByAltText",
57-
"queryAllByAltText",
58-
"queryByAltText",
5936
"findAllByTitle",
60-
"findByTitle",
61-
"getAllByTitle",
62-
"getByTitle",
63-
"queryAllByTitle",
64-
"queryByTitle",
65-
"findAllByRole",
37+
"findByAltText",
38+
"findByDisplayValue",
39+
"findByLabelText",
40+
"findByPlaceholderText",
6641
"findByRole",
67-
"getAllByRole",
68-
"getByRole",
69-
"queryAllByRole",
70-
"queryByRole",
71-
"findAllByTestId",
7242
"findByTestId",
43+
"findByText",
44+
"findByTitle",
45+
"getAllByAltText",
46+
"getAllByDisplayValue",
47+
"getAllByLabelText",
48+
"getAllByPlaceholderText",
49+
"getAllByRole",
7350
"getAllByTestId",
51+
"getAllByText",
52+
"getAllByTitle",
53+
"getByAltText",
54+
"getByDisplayValue",
55+
"getByLabelText",
56+
"getByPlaceholderText",
57+
"getByRole",
7458
"getByTestId",
59+
"getByText",
60+
"getByTitle",
61+
"queryAllByAltText",
62+
"queryAllByDisplayValue",
63+
"queryAllByLabelText",
64+
"queryAllByPlaceholderText",
65+
"queryAllByRole",
7566
"queryAllByTestId",
67+
"queryAllByText",
68+
"queryAllByTitle",
69+
"queryByAltText",
70+
"queryByDisplayValue",
71+
"queryByLabelText",
72+
"queryByPlaceholderText",
73+
"queryByRole",
7674
"queryByTestId",
75+
"queryByText",
76+
"queryByTitle",
7777
]);
7878
});
7979
});
@@ -82,55 +82,55 @@ describe("when @testing-library/dom is available", () => {
8282
it("returns the queries from the library", () => {
8383
const { queries } = requireQueries(false);
8484

85-
expect(queries).toStrictEqual([
85+
expect([...queries].sort()).toStrictEqual([
86+
"findAllByAltText",
87+
"findAllByDisplayValue",
8688
"findAllByLabelText",
87-
"findByLabelText",
88-
"getAllByLabelText",
89-
"getByLabelText",
90-
"queryAllByLabelText",
91-
"queryByLabelText",
9289
"findAllByPlaceholderText",
93-
"findByPlaceholderText",
94-
"getAllByPlaceholderText",
95-
"getByPlaceholderText",
96-
"queryAllByPlaceholderText",
97-
"queryByPlaceholderText",
90+
"findAllByRole",
91+
"findAllByTestId",
9892
"findAllByText",
99-
"findByText",
100-
"getAllByText",
101-
"getByText",
102-
"queryAllByText",
103-
"queryByText",
104-
"findAllByDisplayValue",
105-
"findByDisplayValue",
106-
"getAllByDisplayValue",
107-
"getByDisplayValue",
108-
"queryAllByDisplayValue",
109-
"queryByDisplayValue",
110-
"findAllByAltText",
111-
"findByAltText",
112-
"getAllByAltText",
113-
"getByAltText",
114-
"queryAllByAltText",
115-
"queryByAltText",
11693
"findAllByTitle",
117-
"findByTitle",
118-
"getAllByTitle",
119-
"getByTitle",
120-
"queryAllByTitle",
121-
"queryByTitle",
122-
"findAllByRole",
94+
"findByAltText",
95+
"findByDisplayValue",
96+
"findByLabelText",
97+
"findByPlaceholderText",
12398
"findByRole",
124-
"getAllByRole",
125-
"getByRole",
126-
"queryAllByRole",
127-
"queryByRole",
128-
"findAllByTestId",
12999
"findByTestId",
100+
"findByText",
101+
"findByTitle",
102+
"getAllByAltText",
103+
"getAllByDisplayValue",
104+
"getAllByLabelText",
105+
"getAllByPlaceholderText",
106+
"getAllByRole",
130107
"getAllByTestId",
108+
"getAllByText",
109+
"getAllByTitle",
110+
"getByAltText",
111+
"getByDisplayValue",
112+
"getByLabelText",
113+
"getByPlaceholderText",
114+
"getByRole",
131115
"getByTestId",
116+
"getByText",
117+
"getByTitle",
118+
"queryAllByAltText",
119+
"queryAllByDisplayValue",
120+
"queryAllByLabelText",
121+
"queryAllByPlaceholderText",
122+
"queryAllByRole",
132123
"queryAllByTestId",
124+
"queryAllByText",
125+
"queryAllByTitle",
126+
"queryByAltText",
127+
"queryByDisplayValue",
128+
"queryByLabelText",
129+
"queryByPlaceholderText",
130+
"queryByRole",
133131
"queryByTestId",
132+
"queryByText",
133+
"queryByTitle",
134134
]);
135135
});
136136

0 commit comments

Comments
 (0)