You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
path: '/api/search/v1/collections/all/items?filter=((group IN (864dfb9be4ef483d864e886fa25e1c94)))%20AND%20((categories%20IN%20(%2Fcategories%2F%E5%B8%82%E5%8C%BA%E7%94%BA%E6%9D%91%E3%83%AC%E3%83%99%E3%83%AB%2F%E9%A6%99%E5%B7%9D%E7%9C%8C)))&limit=12&q=%E9%A6%99%E5%B7%9D%E7%9C%8C%E9%AB%98%E6%9D%BE%E5%B8%82',
42
+
method: 'GET',
43
+
}).reply(
44
+
404,{
45
+
message: "Cannot GET /api/search/v1/collections/all/items",
46
+
error: "Not Found",
47
+
statusCode: 404
48
+
},{
49
+
headers: {'content-type': 'application/geo+json'}
50
+
}
51
+
);
21
52
22
-
// TODO: エラー用のモック作成
23
-
/*
24
-
await test('getHubItemsByQuery should handle fetch error', async () => {
path: '/api/search/v1/collections/all/items?filter=((group IN (864dfb9be4ef483d864e886fa25e1c94)))%20AND%20((categories%20IN%20(%2Fcategories%2F%E5%B8%82%E5%8C%BA%E7%94%BA%E6%9D%91%E3%83%AC%E3%83%99%E3%83%AB%2F%E9%A6%99%E5%B7%9D%E7%9C%8C)))&limit=12&q=%E9%A6%99%E5%B7%9D%E7%9C%8C%E9%AB%98%E6%9D%BE%E5%B8%82',
69
+
method: 'GET',
70
+
}).reply(
71
+
404,
72
+
"Not Found"
73
+
);
74
+
75
+
awaitassert.rejects(
76
+
hub.getHubItemsByQuery('香川県高松市','市区町村レベル','香川県'),
77
+
newError('HUB API returned an error: 404 Not Found')
78
+
);
79
+
80
+
awaitmockAgent.close();
81
+
setGlobalDispatcher(newAgent());
82
+
});
83
+
84
+
awaittest('getHubItemsByQuery should handle fetch error when network is disconnected',async()=>{
85
+
constmockAgent=newMockAgent();
86
+
setGlobalDispatcher(mockAgent);
87
+
mockAgent.disableNetConnect();
88
+
89
+
awaitassert.rejects(
90
+
hub.getHubItemsByQuery('香川県高松市','市区町村レベル','香川県'),
91
+
newTypeError('fetch failed')
92
+
);
47
93
48
-
awaittest('getHubItemById should find existing data',async()=>{
newError('HUB API returned an error: {"message":"Cannot find item with recordId xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx in collection All","error":"Not Found","statusCode":404}')
0 commit comments