Skip to content

Commit 75083bf

Browse files
authored
feat(topics): Add new 'Home' topic as an option in the tool (#1212)
* feat(topics): Add new 'Home' topic as an option in the tool * Fix tests
1 parent 45df0a0 commit 75083bf

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/curated-corpus/helpers/definitions.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export interface DropdownOption {
1313
code: string;
1414
name: string;
1515
}
16-
// This is a list of topics. The 15 "standard" topics + coronavirus.
16+
// This is a list of topics. The 16 "standard" topics + coronavirus.
1717
export const topics: DropdownOption[] = [
1818
{ code: Topics.Business, name: 'Business' },
1919
{ code: Topics.Career, name: 'Career' },
@@ -23,6 +23,7 @@ export const topics: DropdownOption[] = [
2323
{ code: Topics.Food, name: 'Food' },
2424
{ code: Topics.Gaming, name: 'Gaming' },
2525
{ code: Topics.HealthFitness, name: 'Health & Fitness' },
26+
{ code: Topics.Home, name: 'Home' },
2627
{ code: Topics.Parenting, name: 'Parenting' },
2728
{ code: Topics.PersonalFinance, name: 'Personal Finance' },
2829
{ code: Topics.Politics, name: 'Politics' },

src/curated-corpus/helpers/topics.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('helper functions related to topics', () => {
4343
expect(topics).to.be.an('array');
4444
// However, we're getting the entire list of topics here,
4545
// not just the ones stories belong to
46-
expect(topics).to.have.lengthOf(16);
46+
expect(topics).to.have.lengthOf(17);
4747

4848
// And we expect to see the story topics, with the correct counts
4949
expect(topics).to.contain.deep.members([
@@ -89,12 +89,12 @@ describe('helper functions related to topics', () => {
8989

9090
it('returns a list of topics without "Coronavirus" if requested', () => {
9191
const topics = getGroupedTopicData(data, true, false);
92-
expect(topics).to.be.an('array').with.lengthOf(15);
92+
expect(topics).to.be.an('array').with.lengthOf(16);
9393
});
9494

9595
it('returns a full list of topics if requested', () => {
9696
const topics = getGroupedTopicData(data);
97-
expect(topics).to.be.an('array').with.lengthOf(16);
97+
expect(topics).to.be.an('array').with.lengthOf(17);
9898
});
9999
});
100100
});

0 commit comments

Comments
 (0)