-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from sanctuuary/dev
Release 1.3.0
- Loading branch information
Showing
27 changed files
with
788 additions
and
587 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,6 @@ import com.ninjasquad.springmockk.MockkBean | |
import io.mockk.every | ||
import io.mockk.mockk | ||
import org.bson.types.ObjectId | ||
import org.junit.jupiter.api.Disabled | ||
import org.junit.jupiter.api.Test | ||
import org.junit.jupiter.api.extension.ExtendWith | ||
import org.springframework.beans.factory.annotation.Autowired | ||
|
@@ -226,14 +225,42 @@ class DomainControllerMVCTest(@Autowired val context: WebApplicationContext) { | |
} | ||
} | ||
|
||
@Disabled | ||
@Test | ||
fun `Public domains are retrieved correctly`() { | ||
val domain = Domain(t, t, t, DomainVisibility.Public, t, t, listOf(t), true) | ||
val domainRequest = DomainRequest(domain.id.toHexString(), t, listOf(t), t) | ||
val user = User("[email protected]", "test", "TestUser", UserStatus.Approved) | ||
|
||
every { domain.id.toHexString() } returns "testId" | ||
|
||
val domainRequest = DomainRequest(domain.id.toHexString(), t, listOf(t), t, false, user.displayName) | ||
|
||
every { domainCollection.getPublicDomains() } returns listOf(domain) | ||
every { domainOperation.getTopics(any()) } returns listOf(Topic(t)) | ||
every { domainOperation.getOwner(domain.id) } returns user | ||
every { userOperation.userIsAdmin(user.email) } returns false | ||
|
||
val expected = ow.writeValueAsString(listOf(domainRequest)) | ||
mockMvc.get("/domain/") { | ||
contentType = MediaType.APPLICATION_JSON | ||
}.andExpect { | ||
status { isOk } | ||
content { json(expected) } | ||
} | ||
} | ||
|
||
@Test | ||
fun `Public domains are flagged as official correctly`() { | ||
val domain = Domain(t, t, t, DomainVisibility.Public, t, t, listOf(t), true) | ||
val user = User("[email protected]", "test", "TestUser", UserStatus.Approved) | ||
|
||
every { domain.id.toHexString() } returns "testId" | ||
|
||
val domainRequest = DomainRequest(domain.id.toHexString(), t, listOf(t), t, true, user.displayName) | ||
|
||
every { domainCollection.getPublicDomains() } returns listOf(domain) | ||
every { domainOperation.getTopics(any()) } returns listOf(Topic(t)) | ||
every { domainOperation.getOwner(domain.id) } returns user | ||
every { userOperation.userIsAdmin(user.email) } returns true | ||
|
||
val expected = ow.writeValueAsString(listOf(domainRequest)) | ||
mockMvc.get("/domain/") { | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "front-end", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"private": true, | ||
"scripts": { | ||
"dev": "next dev", | ||
|
Oops, something went wrong.