Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/curated-corpus/helpers/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface DropdownOption {
code: string;
name: string;
}
// This is a list of topics. The 15 "standard" topics + coronavirus.
// This is a list of topics. The 16 "standard" topics + coronavirus.
export const topics: DropdownOption[] = [
{ code: Topics.Business, name: 'Business' },
{ code: Topics.Career, name: 'Career' },
Expand All @@ -23,6 +23,7 @@ export const topics: DropdownOption[] = [
{ code: Topics.Food, name: 'Food' },
{ code: Topics.Gaming, name: 'Gaming' },
{ code: Topics.HealthFitness, name: 'Health & Fitness' },
{ code: Topics.Home, name: 'Home' },
{ code: Topics.Parenting, name: 'Parenting' },
{ code: Topics.PersonalFinance, name: 'Personal Finance' },
{ code: Topics.Politics, name: 'Politics' },
Expand Down
6 changes: 3 additions & 3 deletions src/curated-corpus/helpers/topics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('helper functions related to topics', () => {
expect(topics).to.be.an('array');
// However, we're getting the entire list of topics here,
// not just the ones stories belong to
expect(topics).to.have.lengthOf(16);
expect(topics).to.have.lengthOf(17);

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

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

it('returns a full list of topics if requested', () => {
const topics = getGroupedTopicData(data);
expect(topics).to.be.an('array').with.lengthOf(16);
expect(topics).to.be.an('array').with.lengthOf(17);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With most of the test updates involving updating the number of topics expected, should tests be modified to not check for the total number of topics? Should we compare them to the enums in the generated code instead?

Or is adding a topic going to be a rare enough event that it's fine to leave this - and by extension the process of adding a topic - as-is?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good question and i'm not sure we know the answer yet re: how often will we get new topics. but - i think your point about avoiding testing a specific number of topics is sound. we should stop testing the number - i think testing against the enum sounds good.

});
});
});