Skip to content

Commit

Permalink
disabled invalidated tests for getWorkspace(workspaceId)
Browse files Browse the repository at this point in the history
  • Loading branch information
blakery committed Sep 20, 2024
1 parent 3af0fd5 commit ddf3d55
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,13 @@ class WorkspaceServiceUnitTests extends AnyFlatSpec with OptionValues with Mocki
billingRepository
)(scala.concurrent.ExecutionContext.global)

"getWorkspaceById" should "return the workspace returned by getWorkspace(WorkspaceName) on success" in {
behavior of "getWorkspaceById"
// TODO:
// These should all now work mostly the same as using the workspace name
// When proper unit tests are added there, these should be converted and re-enabled
// In the meantime, getWorkspace(workspaceId) no longer relies on getWorkspace(WorkspaceName) directly,
// so these (correctly) fail
ignore should "return the workspace returned by getWorkspace(WorkspaceName) on success" in {
val datasource = mock[SlickDataSource]
when(datasource.inTransaction[Any](any(), any())).thenReturn(Future.successful(List(("abc", "cba"))))

Expand All @@ -136,7 +142,7 @@ class WorkspaceServiceUnitTests extends AnyFlatSpec with OptionValues with Mocki
verify(service).getWorkspace(ArgumentMatchers.eq(WorkspaceName("abc", "cba")), any())
}

it should "return the exception thrown by getWorkspace(WorkspaceName) on failure" in {
ignore should "return the exception thrown by getWorkspace(WorkspaceName) on failure" in {
val datasource = mock[SlickDataSource]
when(datasource.inTransaction[Any](any(), any())).thenReturn(Future.successful(List(("abc", "cba"))))

Expand All @@ -157,7 +163,7 @@ class WorkspaceServiceUnitTests extends AnyFlatSpec with OptionValues with Mocki
verify(service).getWorkspace(ArgumentMatchers.eq(WorkspaceName("abc", "cba")), any())
}

it should "return an exception without the workspace name when getWorkspace(WorkspaceName) is not found" in {
ignore should "return an exception without the workspace name when getWorkspace(WorkspaceName) is not found" in {
val workspaceFields: Future[Seq[(String, String)]] = Future.successful(List(("abc", "123")))
val datasource = mock[SlickDataSource]
when(datasource.inTransaction[Any](any(), any())).thenReturn(workspaceFields)
Expand All @@ -177,7 +183,7 @@ class WorkspaceServiceUnitTests extends AnyFlatSpec with OptionValues with Mocki
verify(service).getWorkspace(ArgumentMatchers.eq(WorkspaceName("abc", "123")), any())
}

it should "return an exception without the workspace name when getWorkspace(WorkspaceName) fails access checks" in {
ignore should "return an exception without the workspace name when getWorkspace(WorkspaceName) fails access checks" in {
val workspaceFields: Future[Seq[(String, String)]] = Future.successful(List(("abc", "123")))
val datasource = mock[SlickDataSource]
when(datasource.inTransaction[Any](any(), any())).thenReturn(workspaceFields)
Expand All @@ -198,7 +204,7 @@ class WorkspaceServiceUnitTests extends AnyFlatSpec with OptionValues with Mocki
verify(service).getWorkspace(ArgumentMatchers.eq(WorkspaceName("abc", "123")), any())
}

it should "return an exception with the workspaceId when no workspace is found in the initial query" in {
ignore should "return an exception with the workspaceId when no workspace is found in the initial query" in {
val datasource = mock[SlickDataSource]
when(datasource.inTransaction[Any](any(), any())).thenReturn(Future.successful(List()))

Expand Down

0 comments on commit ddf3d55

Please sign in to comment.