Broken master: jest-as-if-foss is failing in spec/frontend/users_select/index_spec.js
As seen in https://gitlab.com/gitlab-org/gitlab/-/jobs/1180933284:
Summary of all failing tests
FAIL spec/frontend/users_select/index_spec.js
● ~/users_select/index › when opened › when users are selected › shows assignee
expect(received).toEqual(expected) // deep equality
- Expected - 5
+ Received + 5
@@ -5,16 +5,12 @@
},
Object {
"type": "divider",
},
Object {
- "text": "Assignee(s)",
+ "text": "Assignee",
"type": "dropdown-header",
- },
- Object {
- "type": "user",
- "userId": "109",
},
Object {
"type": "user",
"userId": "111",
},
@@ -26,10 +22,14 @@
"userId": "104",
},
Object {
"type": "user",
"userId": "108",
+ },
+ Object {
+ "type": "user",
+ "userId": "109",
},
Object {
"type": "user",
"userId": "110",
},
141 |
142 | it('shows assignee', () => {
> 143 | expect(findDropdownItemsModel()).toEqual(expectation);
| ^
144 | });
145 |
146 | it('shows assignee even after close and open', () => {
at Object.<anonymous> (spec/frontend/users_select/index_spec.js:143:42)
at runMicrotasks (<anonymous>)
● ~/users_select/index › when opened › when users are selected › shows assignee even after close and open
expect(received).toEqual(expected) // deep equality
- Expected - 5
+ Received + 5
@@ -5,16 +5,12 @@
},
Object {
"type": "divider",
},
Object {
- "text": "Assignee(s)",
+ "text": "Assignee",
"type": "dropdown-header",
- },
- Object {
- "type": "user",
- "userId": "109",
},
Object {
"type": "user",
"userId": "111",
},
@@ -26,10 +22,14 @@
"userId": "104",
},
Object {
"type": "user",
"userId": "108",
+ },
+ Object {
+ "type": "user",
+ "userId": "109",
},
Object {
"type": "user",
"userId": "110",
},
148 | toggleDropdown();
149 |
> 150 | expect(findDropdownItemsModel()).toEqual(expectation);
| ^
151 | });
152 |
153 | it('updates field', () => {
at Object.<anonymous> (spec/frontend/users_select/index_spec.js:150:42)
at runMicrotasks (<anonymous>)
● ~/users_select/index › when opened › when users are selected › updates field
expect(received).toEqual(expected) // deep equality
- Expected - 15
+ Received + 0
@@ -1,24 +1,9 @@
Array [
Object {
"dataset": Object {
"approved": "false",
- "avatar_url": "https://www.gravatar.com/avatar/c05fbd8ce5a00b04718a2c97a3e3fb3f?s=80&d=identicon",
- "can_merge": "false",
- "can_update_merge_request": "true",
- "id": "109",
- "name": "John Doe101",
- "show_status": "false",
- "state": "active",
- "username": "user109",
- "web_url": "http://localhost/user109",
- },
- "value": "109",
- },
- Object {
- "dataset": Object {
- "approved": "false",
"avatar_url": "https://www.gravatar.com/avatar/3673054259a089b09fa4ed87cade913f?s=80&d=identicon",
"can_merge": "false",
"can_update_merge_request": "true",
"id": "111",
"name": "John Doe103",
152 |
153 | it('updates field', () => {
> 154 | expect(findAssigneesInputsModel()).toEqual(
| ^
155 | selectedUsers.map((user) => ({
156 | value: user.id.toString(),
157 | dataset: {
at Object.<anonymous> (spec/frontend/users_select/index_spec.js:154:44)
at runMicrotasks (<anonymous>)
● ~/users_select/index › with preselected user and opened › shows users
expect(received).toEqual(expected) // deep equality
- Expected - 1
+ Received + 1
@@ -5,11 +5,11 @@
},
Object {
"type": "divider",
},
Object {
- "text": "Assignee(s)",
+ "text": "Assignee",
"type": "dropdown-header",
},
Object {
"type": "user",
"userId": "104",
186 |
187 | it('shows users', () => {
> 188 | expect(findDropdownItemsModel()).toEqual(expectation);
| ^
189 | });
190 |
191 | // Regression test for https://gitlab.com/gitlab-org/gitlab/-/issues/325991
at Object.<anonymous> (spec/frontend/users_select/index_spec.js:188:40)
at runMicrotasks (<anonymous>)
● ~/users_select/index › with preselected user and opened › when closed and reopened › shows users
expect(received).toEqual(expected) // deep equality
- Expected - 1
+ Received + 1
@@ -5,11 +5,11 @@
},
Object {
"type": "divider",
},
Object {
- "text": "Assignee(s)",
+ "text": "Assignee",
"type": "dropdown-header",
},
Object {
"type": "user",
"userId": "104",
197 |
198 | it('shows users', () => {
> 199 | expect(findDropdownItemsModel()).toEqual(expectation);
| ^
200 | });
201 | });
202 | });
at Object.<anonymous> (spec/frontend/users_select/index_spec.js:199:42)
at runMicrotasks (<anonymous>)
Test Suites: 1 failed, 858 passed, 859 total
Tests: 5 failed, 6 todo, 10244 passed, 10255 total
Snapshots: 125 passed, 125 total
Time: 828.634 s
Ran all test suites.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Cleaning up file based variables
@pslaughter @dstull This looks like a multiple assignee issue not available in FOSS? !57513 (merged)
Edited by Stan Hu