mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-03 22:31:52 +00:00
Fixed unhandled promise in remoteServers.test
This commit is contained in:
@@ -13,7 +13,7 @@ describe('remoteServersReducer', () => {
|
||||
|
||||
it.each([
|
||||
[
|
||||
Promise.resolve({
|
||||
{
|
||||
data: [
|
||||
{
|
||||
id: '111',
|
||||
@@ -28,7 +28,7 @@ describe('remoteServersReducer', () => {
|
||||
apiKey: '7a531c75-134e-4d5c-86e0-a71b7167b57a',
|
||||
},
|
||||
],
|
||||
}),
|
||||
},
|
||||
{
|
||||
111: {
|
||||
id: '111',
|
||||
@@ -44,8 +44,44 @@ describe('remoteServersReducer', () => {
|
||||
},
|
||||
},
|
||||
],
|
||||
[ Promise.resolve('<html></html>'), {}],
|
||||
[ Promise.reject({}), {}],
|
||||
[
|
||||
{
|
||||
data: [
|
||||
{
|
||||
id: '111',
|
||||
name: 'acel.me from servers.json',
|
||||
url: 'https://acel.me',
|
||||
apiKey: '07fb8a96-8059-4094-a24c-80a7d5e7e9b0',
|
||||
},
|
||||
{
|
||||
id: '222',
|
||||
name: 'Invalid',
|
||||
},
|
||||
{
|
||||
id: '333',
|
||||
name: 'Local from servers.json',
|
||||
url: 'http://localhost:8000',
|
||||
apiKey: '7a531c75-134e-4d5c-86e0-a71b7167b57a',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
111: {
|
||||
id: '111',
|
||||
name: 'acel.me from servers.json',
|
||||
url: 'https://acel.me',
|
||||
apiKey: '07fb8a96-8059-4094-a24c-80a7d5e7e9b0',
|
||||
},
|
||||
333: {
|
||||
id: '333',
|
||||
name: 'Local from servers.json',
|
||||
url: 'http://localhost:8000',
|
||||
apiKey: '7a531c75-134e-4d5c-86e0-a71b7167b57a',
|
||||
},
|
||||
},
|
||||
],
|
||||
[ '<html></html>', {}],
|
||||
[{}, {}],
|
||||
])('tries to fetch servers from remote', async (mockedValue, expectedNewServers) => {
|
||||
get.mockResolvedValue(mockedValue);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user