Skip to content

Commit

Permalink
Wait for UI to update so that test passes consistently
Browse files Browse the repository at this point in the history
  • Loading branch information
BellringerQuinn committed Oct 11, 2023
1 parent a5b5460 commit 6d8315d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Assets/SequenceExamples/Scripts/Tests/SearchTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,14 @@ public IEnumerator ToggleViewAllPageTest()
AssertAllDisplayedSearchablesAreOfTypeT<SearchableCollection>(elementLayoutGroup);

tokenToggle.OnPointerClick(new PointerEventData(EventSystem.current));
yield return new WaitForEndOfFrame(); // Allow UI to update

Assert.IsFalse(collectionToggle.isOn);
Assert.IsTrue(tokenToggle.isOn);
AssertAllDisplayedSearchablesAreOfTypeT<TokenElement>(elementLayoutGroup);

collectionToggle.OnPointerClick(new PointerEventData(EventSystem.current));
yield return new WaitForEndOfFrame(); // Allow UI to update

Assert.IsTrue(collectionToggle.isOn);
Assert.IsFalse(tokenToggle.isOn);
Expand All @@ -385,12 +387,14 @@ public IEnumerator ToggleViewAllPageTest()
AssertAllDisplayedSearchablesAreOfTypeT<TokenElement>(elementLayoutGroup);

collectionToggle.OnPointerClick(new PointerEventData(EventSystem.current));
yield return new WaitForEndOfFrame(); // Allow UI to update

Assert.IsTrue(collectionToggle.isOn);
Assert.IsFalse(tokenToggle.isOn);
AssertAllDisplayedSearchablesAreOfTypeT<SearchableCollection>(elementLayoutGroup);

tokenToggle.OnPointerClick(new PointerEventData(EventSystem.current));
yield return new WaitForEndOfFrame(); // Allow UI to update

Assert.IsFalse(collectionToggle.isOn);
Assert.IsTrue(tokenToggle.isOn);
Expand Down

0 comments on commit 6d8315d

Please sign in to comment.