This regressed in our previous fix that made sure child tabs don't
mistakenly get moved out of the group if their parent is navigated
away, or in case the child tabs are redirected.
However, when a subsequent load occurs in any tab in the group the
search terms need to be cleared and the tab removed from the group
to prevent false positives.
store.dispatch(ContentAction.UpdateHistoryStateAction(parentTab.id,listOf(HistoryItem("Google - mozilla website","https://google.com?q=mozilla+website"),HistoryItem("Firefox","https://firefox.com")),1)).joinBlocking()
store.dispatch(ContentAction.UpdateHistoryStateAction(parentTab.id,listOf(HistoryItem("Google - mozilla website","https://google.com?q=mozilla+website"),HistoryItem("Firefox","https://firefox.com")),1)).joinBlocking()
@ -186,6 +186,62 @@ class HistoryMetadataMiddlewareTest {
}
}
}
}
@Test
fun`GIVEN tab with search terms WHEN subsequent direct load occurs THEN search terms are not retained`(){
store.dispatch(ContentAction.UpdateHistoryStateAction(parentTab.id,listOf(HistoryItem("Google - mozilla website","https://google.com?q=mozilla+website")),0)).joinBlocking()
store.dispatch(ContentAction.UpdateHistoryStateAction(parentTab.id,listOf(HistoryItem("Google - mozilla website","https://google.com?q=mozilla+website"),HistoryItem("Firefox","https://firefox.com")),1)).joinBlocking()