Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix all mistakes in the /home page #543

Merged
merged 2 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,24 @@ public void findAll() throws Exception {
//We expect the content type to be "application/hal+json;charset=UTF-8"
.andExpect(content().contentType(contentType))

//Our default Discovery config has 5 browse indexes, so we expect this to be reflected in the page
//Our default Discovery config has 6 browse indexes, so we expect this to be reflected in the page
// object
.andExpect(jsonPath("$.page.size", is(20)))
.andExpect(jsonPath("$.page.totalElements", is(5)))
.andExpect(jsonPath("$.page.totalElements", is(6)))
.andExpect(jsonPath("$.page.totalPages", is(1)))
.andExpect(jsonPath("$.page.number", is(0)))

//The array of browse index should have a size 5
.andExpect(jsonPath("$._embedded.browses", hasSize(5)))
//The array of browse index should have a size 6
.andExpect(jsonPath("$._embedded.browses", hasSize(6)))

//Check that all (and only) the default browse indexes are present
.andExpect(jsonPath("$._embedded.browses", containsInAnyOrder(
BrowseIndexMatcher.dateIssuedBrowseIndex("asc"),
BrowseIndexMatcher.contributorBrowseIndex("asc"),
BrowseIndexMatcher.titleBrowseIndex("asc"),
BrowseIndexMatcher.subjectBrowseIndex("asc"),
BrowseIndexMatcher.hierarchicalBrowseIndex("srsc")
BrowseIndexMatcher.hierarchicalBrowseIndex("srsc"),
BrowseIndexMatcher.languageBrowseIndex("asc")
)))
;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ public static Matcher<? super Object> publisherBrowseIndex(final String order) {

public static Matcher<? super Object> languageBrowseIndex(final String order) {
return allOf(
hasJsonPath("$.metadata", contains("dc.language.iso")),
hasJsonPath("$.metadataBrowse", Matchers.is(true)),
hasJsonPath("$.dataType", equalToIgnoringCase("iso_lang")),
hasJsonPath("$.metadata", contains("local.language.name")),
hasJsonPath("$.browseType", equalToIgnoringCase(BROWSE_TYPE_VALUE_LIST)),
hasJsonPath("$.dataType", equalToIgnoringCase("text")),
hasJsonPath("$.order", equalToIgnoringCase(order)),
hasJsonPath("$.sortOptions[*].name", containsInAnyOrder("title", "dateissued", "dateaccessioned")),
hasJsonPath("$._links.self.href", is(REST_SERVER_URL + "discover/browses/language")),
Expand Down
4 changes: 2 additions & 2 deletions dspace/config/dspace.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -1160,8 +1160,8 @@ webui.browse.index.1 = dateissued:item:dateissued
webui.browse.index.2 = author:metadata:dc.contributor.*\,dc.creator:text
webui.browse.index.3 = title:item:title
webui.browse.index.4 = subject:metadata:dc.subject.*:text
# webui.browse.index.5 = publisher:metadata:dc.publisher:text
# webui.browse.index.6 = language:metadata:dc.language.iso:iso_lang
webui.browse.index.5 = language:metadata:local.language.name:text
# webui.browse.index.6 = publisher:metadata:dc.publisher:text
# webui.browse.index.7 = itemtype:metadata:dc.type:text
# webui.browse.index.8 = rights:metadata:dc.rights.label:text

Expand Down
Loading