@Test public void testFilterAspectsInNavBar() { GIVEN("Sam-+->Bob as Work"); Relation.forUser(Users.Pod2.sam).toUser(Users.Pod2.bob, WORK).doNotLogOut().ensure(); GIVEN("Work aspect post from Sam is added after setup relation"); Menu.openStream(); Feed.ensureNoPost(Users.Pod2.sam, Phrases.POST_FOR_WORK); Feed.addAspectPost(WORK, Phrases.POST_FOR_WORK); GIVEN("Bob-+->Sam as Friends "); Relation.forUser(Users.Pod2.bob).toUser(Users.Pod2.sam, FRIENDS).doNotLogOut().ensure(); GIVEN("Friends and Family aspects post from Bob are added after setup relation"); Menu.openStream(); Feed.ensureNoPost(Users.Pod2.bob, Phrases.POST_FOR_FRIENDS); Feed.addAspectPost(FRIENDS, Phrases.POST_FOR_FRIENDS); Feed.ensureNoPost(Users.Pod2.bob, Phrases.POST_FOR_FAMILY); Feed.addAspectPost(FAMILY, Phrases.POST_FOR_FAMILY); WHEN("In NavBar aspects list all aspects is deselected"); NavBar.openMyAspects(); Aspects.toggleAll(); Aspects.assertToggleAllText("Select all"); THEN("All posts in all aspects is shown"); Feed.assertPost(Users.Pod2.sam, Phrases.POST_FOR_WORK); Feed.assertPost(Users.Pod2.bob, Phrases.POST_FOR_FRIENDS); Feed.assertPost(Users.Pod2.bob, Phrases.POST_FOR_FAMILY); WHEN("In NavBar aspects list some aspects is selected"); Aspects.toggleAspect(ACQUAINTANCES); Aspects.toggleAspect(FRIENDS); THEN("Author's posts limited in these aspects is shown"); AND("posts of users linked in these aspects is shown"); Feed.assertPost(Users.Pod2.sam, Phrases.POST_FOR_WORK); Feed.assertPost(Users.Pod2.bob, Phrases.POST_FOR_FRIENDS); Feed.assertNoPost(Users.Pod2.bob, Phrases.POST_FOR_FAMILY); WHEN("In NavBar aspects list some aspect is deselected"); Aspects.toggleAspect(FRIENDS); THEN("Author's posts limited in this aspect is not shown"); AND("posts of users linked in this aspect is not shown"); Feed.assertNoPost(Users.Pod2.sam, Phrases.POST_FOR_WORK); Feed.assertNoPost(Users.Pod2.bob, Phrases.POST_FOR_FRIENDS); Feed.assertNoPost(Users.Pod2.bob, Phrases.POST_FOR_FAMILY); WHEN("In NavBar aspects list all aspects is selected"); Aspects.toggleAll(); Aspects.assertToggleAllText("Deselect all"); THEN("All posts in all aspects is shown"); Feed.assertPost(Users.Pod2.sam, Phrases.POST_FOR_WORK); Feed.assertPost(Users.Pod2.bob, Phrases.POST_FOR_FRIENDS); Feed.assertPost(Users.Pod2.bob, Phrases.POST_FOR_FAMILY); }