Skip to content
This repository has been archived by the owner on Mar 23, 2022. It is now read-only.

Commit

Permalink
Merge pull request #320 from RaenonX-DL/dev
Browse files Browse the repository at this point in the history
v2.15.0-beta.3 Release
  • Loading branch information
RaenonX authored Oct 2, 2021
2 parents e3f7573 + 5f9fe2a commit 260d9ef
Show file tree
Hide file tree
Showing 24 changed files with 41 additions and 126 deletions.
2 changes: 1 addition & 1 deletion src/api-def
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const UnitInfoLookupLanding = ({analyses}: Props) => {
return unitInfo ? [{entry, unitInfo}] : [];
})
.map(({entry, unitInfo}) => (
<Col lg className="mt-2 mt-lg-0" key={unitInfo.id}>
<Col lg={4} className="mt-2 mt-lg-0 mb-0 mb-lg-2" key={unitInfo.id}>
<UnitInfoEntry unitInfo={unitInfo} analysisMeta={entry} simplified/>
</Col>
))}
Expand Down
4 changes: 2 additions & 2 deletions src/components/pages/gameData/unitInfo/lookup/main.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@ describe('Analysis lookup page', () => {
userEvent.click(searchButton);

expect(fnGetLookup).toHaveBeenCalledTimes(1);
await waitFor(() => expect(screen.getByText(translationEN.posts.analysis.error.noResult)).toBeInTheDocument());
await waitFor(() => expect(screen.getByText(translationEN.misc.noResult)).toBeInTheDocument());
expect(fnScroll).toHaveBeenCalledTimes(2);
const errorText = screen.getByText(translationEN.posts.analysis.error.noResult);
const errorText = screen.getByText(translationEN.misc.noResult);
expect(errorText).toHaveClass('text-danger');
expect(errorText).toHaveClass('text-center');
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/gameData/unitInfo/lookup/out/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const UnitInfoLookupOutput = ({
if (!unitInfoSorted.length) {
return (
<h5 className="text-danger text-center">
{t((t) => t.posts.analysis.error.noResult)}
{t((t) => t.misc.noResult)}
</h5>
);
}
Expand Down
2 changes: 0 additions & 2 deletions src/components/pages/posts/analysis/form/base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ export const AnalysisFormBase = <P extends AnalysisBody, R extends AnalysisEditR
passives: await processText({text: payload.passives, lang}),
normalAttacks: await processText({text: payload.normalAttacks, lang}),
videos: await processText({text: payload.videos, lang}),
story: await processText({text: payload.story, lang}),
keywords: await processText({text: payload.keywords, lang}),
})}
{...props}
/>
Expand Down
40 changes: 9 additions & 31 deletions src/components/pages/posts/analysis/form/bottom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,14 @@ export const FormBottom = <P extends AnalysisBody>({formState, setPayload}: Form
const {payload} = formState;

return (
<>
<Row>
<Col>
<h5>{t((t) => t.posts.analysis.videos)}</h5>
<MarkdownInput
onChanged={(e) => setPayload('videos', e.target.value)}
rows={5} value={payload.videos}
/>
</Col>
</Row>
<hr/>
<Row>
<Col>
<h5>{t((t) => t.posts.analysis.story)}</h5>
<MarkdownInput
onChanged={(e) => setPayload('story', e.target.value)}
rows={5} value={payload.story}
/>
</Col>
</Row>
<hr/>
<Row>
<Col>
<h5>{t((t) => t.posts.analysis.keywords)}</h5>
<MarkdownInput
onChanged={(e) => setPayload('keywords', e.target.value)}
rows={5} value={payload.keywords}
/>
</Col>
</Row>
</>
<Row>
<Col>
<h5>{t((t) => t.posts.analysis.videos)}</h5>
<MarkdownInput
onChanged={(e) => setPayload('videos', e.target.value)}
rows={5} value={payload.videos}
/>
</Col>
</Row>
);
};
2 changes: 0 additions & 2 deletions src/components/pages/posts/analysis/form/chara/edit.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ describe('Character analysis edit form', () => {
],
tipsBuilds: 'tb',
videos: 'vid',
story: 'str',
keywords: 'kw',
}}
/>
),
Expand Down
2 changes: 0 additions & 2 deletions src/components/pages/posts/analysis/form/chara/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ export const AnalysisFormCharaEdit = ({analysis}: Props) => {
skills: analysis.skills,
tipsBuilds: analysis.tipsBuilds,
videos: analysis.videos,
story: analysis.story,
keywords: analysis.keywords,
editNote: '',
},
isIdAvailable: true,
Expand Down
12 changes: 0 additions & 12 deletions src/components/pages/posts/analysis/form/chara/main.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ describe('Character analysis form', () => {
],
tipsBuilds: 'tb',
videos: 'vid',
keywords: 'kw',
story: 'str',
editNote: '',
},
};
Expand Down Expand Up @@ -102,10 +100,6 @@ describe('Character analysis form', () => {
typeInput(tipsBuilds, 'tipsBuilds', {clear: true, rerender});
const videos = screen.getByText(formState.payload.videos, {selector: 'textarea'});
typeInput(videos, 'videos', {clear: true, rerender});
const keywords = screen.getByText(formState.payload.keywords, {selector: 'textarea'});
typeInput(keywords, 'keywords', {clear: true, rerender});
const story = screen.getByText(formState.payload.story, {selector: 'textarea'});
typeInput(story, 'story', {clear: true, rerender});
// endregion

const editButton = screen.getByText(translationEN.posts.manage.edit);
Expand All @@ -125,8 +119,6 @@ describe('Character analysis form', () => {
skills: formState.payload.skills,
tipsBuilds: 'tipsBuilds',
videos: 'videos',
keywords: 'keywords',
story: 'story',
editNote: '',
});
});
Expand Down Expand Up @@ -214,8 +206,6 @@ describe('Character analysis form', () => {
}],
tipsBuilds: originalText,
videos: originalText,
keywords: originalText,
story: originalText,
editNote: originalText,
};

Expand Down Expand Up @@ -252,8 +242,6 @@ describe('Character analysis form', () => {
}],
tipsBuilds: transformedText,
videos: transformedText,
keywords: transformedText,
story: transformedText,
editNote: originalText,
});
});
Expand Down
6 changes: 4 additions & 2 deletions src/components/pages/posts/analysis/form/chara/new.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ describe('New character analysis form', () => {
dragon: null,
},
quest: null,
misc: null,
},
},
},
Expand Down Expand Up @@ -143,6 +144,7 @@ describe('New character analysis form', () => {
dragon: null,
},
quest: null,
misc: null,
},
},
},
Expand Down Expand Up @@ -182,12 +184,11 @@ describe('New character analysis form', () => {
skills: [],
tipsBuilds: 'tipsBuilds',
videos: 'videos',
keywords: 'keywords',
story: 'story',
},
dragon: null,
},
quest: null,
misc: null,
},
},
},
Expand Down Expand Up @@ -219,6 +220,7 @@ describe('New character analysis form', () => {
dragon: null,
},
quest: null,
misc: null,
},
},
},
Expand Down
2 changes: 0 additions & 2 deletions src/components/pages/posts/analysis/form/chara/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,5 @@ export const generatePayload = (lang: SupportedLanguages, uid?: string): CharaAn
],
tipsBuilds: '',
videos: '',
story: '',
keywords: '',
};
};
2 changes: 0 additions & 2 deletions src/components/pages/posts/analysis/form/dragon/edit.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ describe('Dragon analysis edit form', () => {
suitableCharacters: 'sut',
notes: 'not',
videos: 'vid',
story: 'str',
keywords: 'kw',
}}
/>
),
Expand Down
2 changes: 0 additions & 2 deletions src/components/pages/posts/analysis/form/dragon/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ export const AnalysisFormDragonEdit = ({analysis}: Props) => {
suitableCharacters: analysis.suitableCharacters,
notes: analysis.notes,
videos: analysis.videos,
story: analysis.story,
keywords: analysis.keywords,
editNote: '',
},
isIdAvailable: true,
Expand Down
2 changes: 0 additions & 2 deletions src/components/pages/posts/analysis/form/dragon/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,5 @@ export const generatePayload = (lang: SupportedLanguages, uid?: string): DragonA
notes: '',
suitableCharacters: '',
videos: '',
story: '',
keywords: '',
};
};
28 changes: 0 additions & 28 deletions src/components/pages/posts/analysis/output/bottom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,34 +32,6 @@ export const SectionBottom = <R extends AnalysisGetResponse>({analysis}: Section
</div>
</>
}
{
analysis.story &&
<>
<hr/>
<Row>
<Col>
<h4 className="mb-3">
{t((t) => t.posts.analysis.story)}
</h4>
<Markdown>{analysis.story}</Markdown>
</Col>
</Row>
</>
}
{
analysis.keywords &&
<>
<hr/>
<Row>
<Col>
<h4 className="mb-3">
{t((t) => t.posts.analysis.keywords)}
</h4>
<Markdown>{analysis.keywords}</Markdown>
</Col>
</Row>
</>
}
</>
);
};
10 changes: 0 additions & 10 deletions src/components/pages/posts/analysis/output/chara.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ describe('Analysis output (Character)', () => {
],
tipsBuilds: 'bld',
videos: 'vid',
story: 'str',
keywords: 'kw',
viewCount: 777,
editNotes: [
{
Expand Down Expand Up @@ -81,8 +79,6 @@ describe('Analysis output (Character)', () => {
expect(screen.getByText('tip')).toBeInTheDocument();
expect(screen.getByText('bld')).toBeInTheDocument();
expect(screen.getByText('vid')).toBeInTheDocument();
expect(screen.getByText('str')).toBeInTheDocument();
expect(screen.getByText('kw')).toBeInTheDocument();
expect(screen.getByText(/777/)).toBeInTheDocument();
expect(screen.getByText(/edn/)).toBeInTheDocument();
expect(screen.queryByText(new RegExp(`${altLangTips}`, 'g'))).not.toBeInTheDocument();
Expand All @@ -109,8 +105,6 @@ describe('Analysis output (Character)', () => {
expect(screen.getByText('tip')).toBeInTheDocument();
expect(screen.getByText('bld')).toBeInTheDocument();
expect(screen.getByText('vid')).toBeInTheDocument();
expect(screen.getByText('str')).toBeInTheDocument();
expect(screen.getByText('kw')).toBeInTheDocument();
expect(screen.getByText(/777/)).toBeInTheDocument();
expect(screen.getByText(/edn/)).toBeInTheDocument();
expect(screen.getByText(new RegExp(`${altLangTips}`, 'g'))).toBeInTheDocument();
Expand Down Expand Up @@ -153,8 +147,6 @@ describe('Analysis output (Character)', () => {
expect(screen.getByText('tip')).toBeInTheDocument();
expect(screen.getByText('bld')).toBeInTheDocument();
expect(screen.getByText('vid')).toBeInTheDocument();
expect(screen.getByText('str')).toBeInTheDocument();
expect(screen.getByText('kw')).toBeInTheDocument();
expect(screen.getByText(/777/)).toBeInTheDocument();
expect(screen.queryByText(/edn/)).not.toBeInTheDocument();
expect(screen.queryByText(new RegExp(`${altLangTips}`, 'g'))).not.toBeInTheDocument();
Expand Down Expand Up @@ -187,8 +179,6 @@ describe('Analysis output (Character)', () => {
expect(screen.getByText('tip')).toBeInTheDocument();
expect(screen.getByText('bld')).toBeInTheDocument();
expect(screen.getByText('vid')).toBeInTheDocument();
expect(screen.getByText('str')).toBeInTheDocument();
expect(screen.getByText('kw')).toBeInTheDocument();
expect(screen.getByText(/777/)).toBeInTheDocument();
expect(screen.getByText(/edn/)).toBeInTheDocument();
expect(screen.queryByText(new RegExp(`${altLangTips}`, 'g'))).not.toBeInTheDocument();
Expand Down
10 changes: 0 additions & 10 deletions src/components/pages/posts/analysis/output/dragon.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ describe('Analysis output (Dragon)', () => {
suitableCharacters: 'suc',
ultimate: 'ult',
videos: 'vid',
story: 'str',
keywords: 'kw',
viewCount: 777,
editNotes: [
{
Expand Down Expand Up @@ -69,8 +67,6 @@ describe('Analysis output (Dragon)', () => {
expect(screen.getByText('suc')).toBeInTheDocument();
expect(screen.getByText('ult')).toBeInTheDocument();
expect(screen.getByText('vid')).toBeInTheDocument();
expect(screen.getByText('str')).toBeInTheDocument();
expect(screen.getByText('kw')).toBeInTheDocument();
expect(screen.getByText(/777/)).toBeInTheDocument();
expect(screen.getByText(/edn/)).toBeInTheDocument();
expect(screen.queryByText(new RegExp(`${altLangTips}`, 'g'))).not.toBeInTheDocument();
Expand All @@ -94,8 +90,6 @@ describe('Analysis output (Dragon)', () => {
expect(screen.getByText('suc')).toBeInTheDocument();
expect(screen.getByText('ult')).toBeInTheDocument();
expect(screen.getByText('vid')).toBeInTheDocument();
expect(screen.getByText('str')).toBeInTheDocument();
expect(screen.getByText('kw')).toBeInTheDocument();
expect(screen.getByText(/777/)).toBeInTheDocument();
expect(screen.getByText(/edn/)).toBeInTheDocument();
expect(screen.queryByText(new RegExp(`${altLangTips}`, 'g'))).toBeInTheDocument();
Expand Down Expand Up @@ -135,8 +129,6 @@ describe('Analysis output (Dragon)', () => {
expect(screen.getByText('suc')).toBeInTheDocument();
expect(screen.getByText('ult')).toBeInTheDocument();
expect(screen.getByText('vid')).toBeInTheDocument();
expect(screen.getByText('str')).toBeInTheDocument();
expect(screen.getByText('kw')).toBeInTheDocument();
expect(screen.getByText(/777/)).toBeInTheDocument();
expect(screen.queryByText(/edn/)).not.toBeInTheDocument();
expect(screen.queryByText(new RegExp(`${altLangTips}`, 'g'))).not.toBeInTheDocument();
Expand All @@ -157,8 +149,6 @@ describe('Analysis output (Dragon)', () => {
expect(screen.getByText('suc')).toBeInTheDocument();
expect(screen.getByText('ult')).toBeInTheDocument();
expect(screen.getByText('vid')).toBeInTheDocument();
expect(screen.getByText('str')).toBeInTheDocument();
expect(screen.getByText('kw')).toBeInTheDocument();
expect(screen.getByText(/777/)).toBeInTheDocument();
expect(screen.getByText(/edn/)).toBeInTheDocument();
expect(screen.queryByText(new RegExp(`${altLangTips}`, 'g'))).not.toBeInTheDocument();
Expand Down
13 changes: 13 additions & 0 deletions src/components/pages/tier/main.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,17 @@ describe('Tier list page', () => {
expect(screen.getByText('B')).toBeInTheDocument();
expect(screen.getByText('C')).toBeInTheDocument();
});

it('shows no result on not found', async () => {
renderReact(() => <TierList/>);

const searchInput = await screen.findByPlaceholderText(translationEN.misc.searchKeyword);
userEvent.type(searchInput, 'test');

const searchButton = await screen.findByText(translationEN.misc.search, {selector: 'button:enabled'});
userEvent.click(searchButton);

// Partial text of the tier note tips
expect(await screen.findByText(translationEN.misc.noResult)).toBeInTheDocument();
});
});
6 changes: 5 additions & 1 deletion src/components/pages/tier/out/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ export const TierListOutput = ({inputData, tierData, prioritizedUnitInfo, otherU
keyPointsData={keyPointsData}
/>
}
{(entryPackHasTierNote.length || entryPackNoTierNote.length) && <AdsTierResultsEnd/>}
{
(entryPackHasTierNote.length > 0 || entryPackNoTierNote.length > 0) ?
<AdsTierResultsEnd/> :
<>{t((t) => t.misc.noResult)}</>
}
</>
);
};
Loading

0 comments on commit 260d9ef

Please sign in to comment.