feat(faq): unify platform FAQs

by @CuriousMagpie with edits by @SabreCat
This commit is contained in:
SabreCat
2023-10-31 11:41:24 -05:00
parent aac3969e6a
commit 33b6de85cc
6 changed files with 719 additions and 242 deletions

View File

@@ -12,7 +12,7 @@ describe('GET /faq', () => {
expect(res).to.have.property('stillNeedHelp');
expect(res.stillNeedHelp.ios).to.equal(translate('iosFaqStillNeedHelp'));
expect(res).to.have.property('questions');
expect(res.questions[0].question).to.equal(translate('faqQuestion0'));
expect(res.questions[0].question).to.equal(translate('faqQuestion25'));
});
it('returns faq not in English', async () => {
@@ -29,20 +29,6 @@ describe('GET /faq', () => {
});
describe('platform parameter', () => {
it('returns faq with answers for ios platform only', async () => {
const res = await requester().get('/faq?platform=ios');
expect(res).to.have.property('stillNeedHelp');
expect(res.stillNeedHelp).to.eql({ ios: translate('iosFaqStillNeedHelp') });
expect(res).to.have.property('questions');
expect(res.questions[0]).to.eql({
exclusions: [],
heading: 'overview',
question: translate('faqQuestion0'),
ios: translate('iosFaqAnswer0'),
});
});
it('returns an error when invalid platform parameter is specified', async () => {
const request = requester().get('/faq?platform=wrong');
await expect(request)
@@ -60,9 +46,9 @@ describe('GET /faq', () => {
expect(res).to.have.property('questions');
expect(res.questions[0]).to.eql({
exclusions: [],
heading: 'overview',
question: translate('faqQuestion0'),
android: translate('androidFaqAnswer0'),
heading: 'task-types',
question: translate('faqQuestion25'),
web: translate('webFaqAnswer25'),
});
});
});