Commit a0d48515 authored by Coung Ngo's avatar Coung Ngo

Fix flaky spec in spec/features/issues/gfm_autocomplete_spec.rb

"GFM autocomplete when tribute_autocomplete feature flag is on
assignees lists users who are currently not assigned to the
issue when using /assign on the second line" was failing
parent 0b757fa8
......@@ -43,7 +43,12 @@ const autoCompleteMap = {
const fullText = this.$slots.default?.[0]?.elm?.value;
const selectionStart = this.$slots.default?.[0]?.elm?.selectionStart;
if (!this.assignees) {
// Need to check whether sidebar store assignees has been updated
// in the case where the assignees AJAX response comes after the user does @ autocomplete
const isAssigneesLengthSame =
this.assignees?.length === SidebarMediator.singleton?.store?.assignees?.length;
if (!this.assignees || !isAssigneesLengthSame) {
this.assignees =
SidebarMediator.singleton?.store?.assignees?.map(assignee => assignee.username) || [];
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment