mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-06-17 18:09:09 +00:00
* feat(web): add server-setup page for when bot isn't in the server picked * chore: move contexts into their own folder * feat(web): add recent guilds context, and app shell helper context * feat(web): show recent guilds in masthead * feat(web): functionally add recents to servers list * fix(web): correct styling for servers listing recents/all headers * fix(web): correct some type issues with appShellProps * fix(web): don't show ServerListing recents when recents is empty
This commit is contained in:
parent
3a36d7a85d
commit
99952aa19f
22 changed files with 302 additions and 66 deletions
15
packages/web/src/contexts/api/getDefaultApiUrl.spec.ts
Normal file
15
packages/web/src/contexts/api/getDefaultApiUrl.spec.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
import { getDefaultApiUrl } from './getDefaultApiUrl';
|
||||
|
||||
it.each([
|
||||
['https://next.roleypoly.com/servers', 'https://api-prod.roleypoly.com'],
|
||||
['https://stage.roleypoly.com/servers', 'https://api-stage.roleypoly.com'],
|
||||
['https://roleypoly.com/servers', 'https://api-prod.roleypoly.com'],
|
||||
['https://notroleypolybutclose.com/servers', 'https://api-prod.roleypoly.com'],
|
||||
['https://myhash.roleypoly.pages.dev/servers', 'https://api-stage.roleypoly.com'],
|
||||
['http://localhost:6601/servers', 'http://localhost:6609'],
|
||||
['http://127.0.0.1:6601/servers', 'http://localhost:6609'],
|
||||
])('matches %s to %s', (inputUrl, outputUrl) => {
|
||||
const urlHostname = new URL(inputUrl).hostname;
|
||||
|
||||
expect(getDefaultApiUrl(urlHostname)).toStrictEqual(outputUrl);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue