Skip to content

Commit

Permalink
feat(faq): unify platform FAQs
Browse files Browse the repository at this point in the history
by @CuriousMagpie with edits by @SabreCat
  • Loading branch information
SabreCat committed Oct 31, 2023
1 parent aac3969 commit 33b6de8
Show file tree
Hide file tree
Showing 6 changed files with 737 additions and 260 deletions.
22 changes: 4 additions & 18 deletions test/api/v4/faq/GET-faq.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -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)
Expand All @@ -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'),
});
});
});
Expand Down
10 changes: 0 additions & 10 deletions test/content/faq.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ describe('FAQ Locales', () => {
});
});

it('has a valid ios answers', () => {
each(questions, question => {
expectValidTranslationString(question.ios);
});
});

it('has a valid web answers', () => {
each(questions, question => {
expectValidTranslationString(question.web);
Expand All @@ -29,10 +23,6 @@ describe('FAQ Locales', () => {
});

describe('Still Need Help Message', () => {
it('has a valid ios message', () => {
expectValidTranslationString(stillNeedHelp.ios);
});

it('has a valid web message', () => {
expectValidTranslationString(stillNeedHelp.web);
});
Expand Down
Loading

0 comments on commit 33b6de8

Please sign in to comment.