// TODO tests for check and uncheck case sensitive check
@Test
public void documentSelectUpdatesHistoryToken() {
HistoryToken documentPathToken = new HistoryToken();
documentPathToken.setDocumentPath(null);
when(mockHistory.getHistoryToken()).thenReturn(documentPathToken);
documentListPresenter.bind();
// simulate document click on second document
DocumentInfo docInfo =
new DocumentInfo(new DocumentId(2222L, ""), "doc122",
"second/path/", LocaleId.EN_US,
new ContainerTranslationStatistics(), new AuditInfo(
new Date(), "Translator"),
new HashMap<String, String>(), new AuditInfo(
new Date(), "last translator"));
documentListPresenter.fireDocumentSelection(docInfo);
verify(mockHistory).newItem(capturedHistoryToken.capture());
verify(mockUserWorkspaceContext).setSelectedDoc(docInfo);
HistoryToken newToken = capturedHistoryToken.getValue();
assertThat("path of selected document should be set in history token",
newToken.getDocumentPath(), is("second/path/doc122"));
assertThat(
"view in history token should change to individual document view when a new document is selected",
newToken.getView(), is(MainView.Editor));
}