-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test case for #173, currently unable to reproduce.
- Loading branch information
Showing
5 changed files
with
65 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System.Text.Json.Nodes; | ||
using Shouldly; | ||
|
||
namespace Testing.ApiTests; | ||
|
||
// issue: https://github.com/sillsdev/languageforge-lexbox/issues/173 | ||
[Trait("Category", "Integration")] | ||
public class NewProjectRaceCondition : ApiTestBase | ||
{ | ||
readonly Guid _projectId = Guid.Parse("3e81814d-ce7e-438f-b8e8-beac1cd7596b"); | ||
[Fact] | ||
public async Task CanCreateProjectAndQueryItRightAway() | ||
{ | ||
|
||
await LoginAs("admin", "pass"); | ||
await HttpClient.DeleteAsync($"http://{Host}/api/project/project/{_projectId}"); | ||
await Task.Delay(TimeSpan.FromSeconds(1)); | ||
var response = await ExecuteGql($$""" | ||
mutation { | ||
createProject(input: { | ||
name: "Test race condition", | ||
type: FL_EX, | ||
id: "{{_projectId}}", | ||
code: "test-race-flex", | ||
description: "this is just a testing project for testing a race condition", | ||
retentionPolicy: DEV | ||
}) { | ||
project { | ||
name | ||
changesets { | ||
desc | ||
} | ||
} | ||
} | ||
} | ||
"""); | ||
var project = response["data"]!["createProject"]!["project"].ShouldBeOfType<JsonObject>(); | ||
project["name"]!.GetValue<string>().ShouldBe("test"); | ||
} | ||
} |
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