Skip to content

Commit 1ee961e

Browse files
MC-1556: Ensure ‘Coronavirus’ is not available as a Topic when adding an Item (#1222)
* MC-1556: nsure ‘Coronavirus’ is not available as a Topic when adding an Item
1 parent 7f5cc5b commit 1ee961e

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/curated-corpus/helpers/definitions.ts

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export interface DropdownOption {
1717
export const topics: DropdownOption[] = [
1818
{ code: Topics.Business, name: 'Business' },
1919
{ code: Topics.Career, name: 'Career' },
20-
{ code: Topics.Coronavirus, name: 'Coronavirus' },
2120
{ code: Topics.Education, name: 'Education' },
2221
{ code: Topics.Entertainment, name: 'Entertainment' },
2322
{ code: Topics.Food, name: 'Food' },

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

+7-7
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ describe('helper functions related to topics', () => {
1919
expect(displayTopic).to.equal('N/A');
2020
});
2121

22+
it('returns "N/A" if topic is Coronavirus', () => {
23+
const displayTopic = getDisplayTopic('Coronavirus');
24+
expect(displayTopic).to.equal('N/A');
25+
});
26+
2227
it('returns "N/A" if topic is not part of shared data topic list', () => {
2328
const displayTopic = getDisplayTopic('BEST_BOOKS');
2429
expect(displayTopic).to.equal('N/A');
@@ -43,7 +48,7 @@ describe('helper functions related to topics', () => {
4348
expect(topics).to.be.an('array');
4449
// However, we're getting the entire list of topics here,
4550
// not just the ones stories belong to
46-
expect(topics).to.have.lengthOf(17);
51+
expect(topics).to.have.lengthOf(16);
4752

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

90-
it('returns a list of topics without "Coronavirus" if requested', () => {
91-
const topics = getGroupedTopicData(data, true, false);
92-
expect(topics).to.be.an('array').with.lengthOf(16);
93-
});
94-
9595
it('returns a full list of topics if requested', () => {
9696
const topics = getGroupedTopicData(data);
97-
expect(topics).to.be.an('array').with.lengthOf(17);
97+
expect(topics).to.be.an('array').with.lengthOf(16);
9898
});
9999
});
100100
});

0 commit comments

Comments
 (0)