Skip to content

Remove flash expectation since JS errors could hide the flash notice

What does this MR do?

Some API calls are made on the group's show page, but since the "leave group by URL" happens on page load (https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/assets/javascripts/namespaces/leave_by_url.js), it could happen that the API calls return a 403 response if the membership destruction happens before them. This is turn results in JS errors, that probably replace the "information" notice You left the \"#{group.full_name}\" group with an error notice Failed to load group activity metrics. Please try again. (https://gitlab.com/gitlab-org/gitlab/-/blob/4a1df327e3b8b8266fff5375dcd7f789c2544d88/ee/app/assets/javascripts/analytics/group_analytics/components/group_activity_card.vue#L59).

Removing the flash expectation work around the problem and the still is still checking that the "leave group by URL" works with expect(group.users).not_to include(user), even though ideally we should be able to expect on the flash notice, in reality the flash notice is a brittle thing since it can be replaced if any unexpected/unrelated JS error occurs (https://gitlab.com/gitlab-org/gitlab/-/blob/4a1df327e3b8b8266fff5375dcd7f789c2544d88/app/assets/javascripts/flash.js#L89).

Does this MR meet the acceptance criteria?

Conformity

Closes #216501 (closed).

Edited by Rémy Coutable

Merge request reports