-
-
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 simple sandbox page test to prove out 500 error checking
- Loading branch information
Showing
6 changed files
with
60 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Microsoft.Playwright; | ||
|
||
namespace Testing.Browser.Page; | ||
|
||
public class SandboxPage : BasePage<SandboxPage> | ||
{ | ||
public SandboxPage(IPage page) : base(page, "/sandbox", page.Locator(":text('Sandbox')")) | ||
{ | ||
} | ||
} |
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,22 @@ | ||
using Shouldly; | ||
using Testing.Browser.Base; | ||
using Testing.Browser.Page; | ||
|
||
namespace Testing.Browser; | ||
|
||
public class SandboxPageTests : PageTest | ||
{ | ||
[Fact] | ||
public async Task Goto500Works() | ||
{ | ||
await new SandboxPage(Page).Goto(); | ||
var request = await Page.RunAndWaitForRequestFinishedAsync(async () => | ||
{ | ||
await Page.GetByText("goto 500 page").ClickAsync(); | ||
}); | ||
var response = await request.ResponseAsync(); | ||
response.ShouldNotBeNull(); | ||
response.Ok.ShouldBeFalse(); | ||
response.Status.ShouldBe(500); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
frontend/src/routes/(unauthenticated)/sandbox/+page.svelte
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,20 @@ | ||
<script lang="ts"> | ||
import TusUpload from '$lib/components/TusUpload.svelte'; | ||
function uploadFinished(): void { | ||
alert('upload done!'); | ||
} | ||
</script> | ||
<div class="grid gap-2"> | ||
<h2>Sandbox</h2> | ||
<div class="card w-96 bg-base-200 shadow-lg"> | ||
<a rel="external" class="btn" href="/api/testing/test500NoException">Goto 500 page</a> | ||
</div> | ||
<div class="card w-96 bg-base-200 shadow-lg"> | ||
<div class="card-body"> | ||
<TusUpload endpoint="/api/tus-test" accept="image/*" on:uploadComplete={uploadFinished}/> | ||
</div> | ||
</div> | ||
</div> | ||
|