feat: add spell and rune tooltips
This commit is contained in:
1 parent
4906f665fd
commit
292e37aaac
8 files changed
+404
-161
No files matched your search
@@ -20,7 +20,7 @@ describe('RiotDdragonService', () => {
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('includes localized item metadata in the manifest', async () => {
|
||||
it('includes localized item, spell, and rune metadata in the manifest', async () => {
|
||||
const fetchMock = jest.fn(async (url: string) => {
|
||||
if (url.endsWith('/api/versions.json')) {
|
||||
return jsonResponse(['15.24.1']);
|
||||
@@ -35,12 +35,40 @@ describe('RiotDdragonService', () => {
|
||||
if (url.endsWith('/summoner.json')) {
|
||||
return jsonResponse({
|
||||
data: {
|
||||
SummonerFlash: { key: '4', id: 'SummonerFlash', name: '점멸' },
|
||||
SummonerFlash: {
|
||||
key: '4',
|
||||
id: 'SummonerFlash',
|
||||
name: '점멸',
|
||||
description: '커서 방향으로 순간이동합니다.',
|
||||
tooltip: '<span>커서 방향으로 순간이동합니다.</span>',
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
if (url.endsWith('/runesReforged.json')) {
|
||||
return jsonResponse([]);
|
||||
return jsonResponse([
|
||||
{
|
||||
id: 8000,
|
||||
key: 'Precision',
|
||||
icon: 'perk-images/Styles/7201_Precision.png',
|
||||
name: '정밀',
|
||||
slots: [
|
||||
{
|
||||
runes: [
|
||||
{
|
||||
id: 8005,
|
||||
key: 'PressTheAttack',
|
||||
icon: 'perk-images/Styles/Precision/PressTheAttack/PressTheAttack.png',
|
||||
name: '집중 공격',
|
||||
shortDesc: '연속 공격 시 추가 피해',
|
||||
longDesc:
|
||||
'<lol-uikit-tooltipped-keyword>기본 공격</lol-uikit-tooltipped-keyword>으로 적을 약화시킵니다.',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
}
|
||||
if (url.endsWith('/item.json')) {
|
||||
return jsonResponse({
|
||||
@@ -70,6 +98,33 @@ describe('RiotDdragonService', () => {
|
||||
await expect(service.getManifest('ko_KR')).resolves.toMatchObject({
|
||||
version: '15.24.1',
|
||||
locale: 'ko_KR',
|
||||
summonerSpells: {
|
||||
'4': {
|
||||
key: 'SummonerFlash',
|
||||
name: '점멸',
|
||||
description: '커서 방향으로 순간이동합니다.',
|
||||
tooltip: '<span>커서 방향으로 순간이동합니다.</span>',
|
||||
},
|
||||
},
|
||||
runesReforged: [
|
||||
{
|
||||
id: 8000,
|
||||
name: '정밀',
|
||||
slots: [
|
||||
{
|
||||
runes: [
|
||||
{
|
||||
id: 8005,
|
||||
name: '집중 공격',
|
||||
shortDesc: '연속 공격 시 추가 피해',
|
||||
longDesc:
|
||||
'<lol-uikit-tooltipped-keyword>기본 공격</lol-uikit-tooltipped-keyword>으로 적을 약화시킵니다.',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
items: {
|
||||
'1055': {
|
||||
name: '도란의 검',
|
||||
@@ -90,8 +145,22 @@ describe('RiotDdragonService', () => {
|
||||
expect.any(Object),
|
||||
);
|
||||
expect(redis.setJson).toHaveBeenCalledWith(
|
||||
'ddragon:manifest:v4:ko_KR',
|
||||
'ddragon:manifest:v5:ko_KR',
|
||||
expect.objectContaining({
|
||||
summonerSpells: expect.objectContaining({
|
||||
'4': expect.objectContaining({ description: '커서 방향으로 순간이동합니다.' }),
|
||||
}),
|
||||
runesReforged: expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
slots: expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
runes: expect.arrayContaining([
|
||||
expect.objectContaining({ longDesc: expect.stringContaining('기본 공격') }),
|
||||
]),
|
||||
}),
|
||||
]),
|
||||
}),
|
||||
]),
|
||||
items: expect.objectContaining({
|
||||
'1055': expect.objectContaining({ name: '도란의 검' }),
|
||||
}),
|
||||
|
||||
Reference in new issue
Block a user