-
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.
Merge pull request #158 from strideynet/strideynet/more-testing
Add a few more tests and reorganise some code
- Loading branch information
Showing
12 changed files
with
128 additions
and
68 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package api | ||
|
||
import ( | ||
"context" | ||
"github.com/stretchr/testify/require" | ||
"io" | ||
"net/http" | ||
"testing" | ||
) | ||
|
||
func TestAPI_DescribeFeedGenerator(t *testing.T) { | ||
if testing.Short() { | ||
t.Skip("skipping integration test") | ||
} | ||
t.Parallel() | ||
|
||
ctx := context.Background() | ||
harness := startAPIHarness(ctx, t) | ||
resp, err := http.Get(harness.APIAddr + "/xrpc/app.bsky.feed.describeFeedGenerator") | ||
require.NoError(t, err) | ||
defer resp.Body.Close() | ||
require.Equal(t, http.StatusOK, resp.StatusCode) | ||
bytes, err := io.ReadAll(resp.Body) | ||
require.NoError(t, err) | ||
|
||
want := `{"did":"did:web:feed.test.furryli.st","feeds":[{"uri":"at://did:web:feed.test.furryli.st/app.bsky.feed.generator/fake-1"}]}` + "\n" | ||
require.Equal(t, want, string(bytes)) | ||
} |
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,28 @@ | ||
package api | ||
|
||
import ( | ||
"context" | ||
"github.com/stretchr/testify/require" | ||
"io" | ||
"net/http" | ||
"testing" | ||
) | ||
|
||
func TestAPI_WellKnownDID(t *testing.T) { | ||
if testing.Short() { | ||
t.Skip("skipping integration test") | ||
} | ||
t.Parallel() | ||
|
||
ctx := context.Background() | ||
harness := startAPIHarness(ctx, t) | ||
resp, err := http.Get(harness.APIAddr + "/.well-known/did.json") | ||
require.NoError(t, err) | ||
defer resp.Body.Close() | ||
require.Equal(t, http.StatusOK, resp.StatusCode) | ||
bytes, err := io.ReadAll(resp.Body) | ||
require.NoError(t, err) | ||
|
||
want := `{"@context":["https://www.w3.org/ns/did/v1"],"id":"did:web:feed.test.furryli.st","service":[{"id":"#bsky_fg","type":"BskyFeedGenerator","serviceEndpoint":"https://feed.test.furryli.st"}]}` + "\n" | ||
require.Equal(t, want, string(bytes)) | ||
} |
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
28693da
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
bsky-furry-feed-admin – ./web/admin
bsky-furry-feed-admin.vercel.app
admin.furryli.st
bsky-furry-feed-admin-git-main-strideynet.vercel.app
bsky-furry-feed-admin-strideynet.vercel.app