public IEnumerator LandingPageUITests_ProjectList_Search() { yield return(GivenUserIsLoggedInAndLandingScreenIsOpen()); var landingPageDialog = Resources.FindObjectsOfTypeAll <LandingScreenUIController>().First(); //Given a list of projects yield return(AddProjects(new[] { "Bay A", "Shop A", "Station A", "Bay B", "Shop B", "Station B", "Bay C", "Shop C", "Station C" })); //When we search for one of the names using (var filterGetter = UISelectorFactory.createSelector <string>(LandingScreenContext.current, nameof(IProjectListFilterDataProvider.searchString))) { Dispatcher.Dispatch(SetLandingScreenFilterProjectServerAction.From("Bay")); yield return(new WaitUntil(() => filterGetter.GetValue() == "Bay")); } yield return(WaitAFrame()); //Then UI should display all projects with the searched string in the name var notFoundDisplayObj = GivenChildNamed(landingPageDialog.gameObject, "No Project Panel"); var projectListContainer = GivenGameObjectNamed("Project List Container"); var items = projectListContainer.GetComponentsInChildren <ProjectListItem>(); Assert.IsFalse(notFoundDisplayObj.activeInHierarchy); Assert.AreEqual(3, items.Length); Assert.IsTrue(items[0].room.project.name.Contains("Bay")); yield return(WaitAFrame()); }
void OnProjectTabButtonClicked(SetLandingScreenFilterProjectServerAction.ProjectServerType projectServerType) { Dispatcher.Dispatch(SetLandingScreenFilterProjectServerAction.From(projectServerType)); }