Skip to content

Commit

Permalink
MC-1556: Ensure ‘Coronavirus’ is not available as a Topic when adding…
Browse files Browse the repository at this point in the history
… an Item (#1222)

* MC-1556: nsure ‘Coronavirus’ is not available as a Topic when adding an Item
  • Loading branch information
katerinachinnappan authored Oct 30, 2024
1 parent 7f5cc5b commit 1ee961e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/curated-corpus/helpers/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export interface DropdownOption {
export const topics: DropdownOption[] = [
{ code: Topics.Business, name: 'Business' },
{ code: Topics.Career, name: 'Career' },
{ code: Topics.Coronavirus, name: 'Coronavirus' },
{ code: Topics.Education, name: 'Education' },
{ code: Topics.Entertainment, name: 'Entertainment' },
{ code: Topics.Food, name: 'Food' },
Expand Down
14 changes: 7 additions & 7 deletions src/curated-corpus/helpers/topics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ describe('helper functions related to topics', () => {
expect(displayTopic).to.equal('N/A');
});

it('returns "N/A" if topic is Coronavirus', () => {
const displayTopic = getDisplayTopic('Coronavirus');
expect(displayTopic).to.equal('N/A');
});

it('returns "N/A" if topic is not part of shared data topic list', () => {
const displayTopic = getDisplayTopic('BEST_BOOKS');
expect(displayTopic).to.equal('N/A');
Expand All @@ -43,7 +48,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(17);
expect(topics).to.have.lengthOf(16);

// And we expect to see the story topics, with the correct counts
expect(topics).to.contain.deep.members([
Expand Down Expand Up @@ -87,14 +92,9 @@ describe('helper functions related to topics', () => {
expect(topics).to.be.an('array').with.lengthOf(5);
});

it('returns a list of topics without "Coronavirus" if requested', () => {
const topics = getGroupedTopicData(data, true, false);
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(17);
expect(topics).to.be.an('array').with.lengthOf(16);
});
});
});

0 comments on commit 1ee961e

Please sign in to comment.