|
| 1 | +/* |
| 2 | + * Copyright 2026 Adobe. All rights reserved. |
| 3 | + * This file is licensed to you under the Apache License, Version 2.0 (the "License"); |
| 4 | + * you may not use this file except in compliance with the License. You may obtain a copy |
| 5 | + * of the License at http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | + * |
| 7 | + * Unless required by applicable law or agreed to in writing, software distributed under |
| 8 | + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS |
| 9 | + * OF ANY KIND, either express or implied. See the License for the specific language |
| 10 | + * governing permissions and limitations under the License. |
| 11 | + */ |
| 12 | + |
| 13 | +import { expect } from 'chai'; |
| 14 | +import { |
| 15 | + OPPORTUNITY_SEMANTIC_SOURCE_TYPES, |
| 16 | + OPPORTUNITY_SEMANTIC_ENTITY_TYPES, |
| 17 | + SUGGESTION_SEMANTIC_SOURCE_TYPES, |
| 18 | + SUGGESTION_SEMANTIC_ENTITY_TYPES, |
| 19 | +} from '../src/constants.js'; |
| 20 | + |
| 21 | +describe('semantic lookup type registries', () => { |
| 22 | + it('lists the opportunity source and entity types', () => { |
| 23 | + expect(OPPORTUNITY_SEMANTIC_SOURCE_TYPES).to.deep.equal({ TOPIC: 'topic' }); |
| 24 | + expect(OPPORTUNITY_SEMANTIC_ENTITY_TYPES).to.deep.equal({ |
| 25 | + CITED_ANALYSIS: 'cited-analysis', |
| 26 | + REDDIT_ANALYSIS: 'reddit-analysis', |
| 27 | + YOUTUBE_ANALYSIS: 'youtube-analysis', |
| 28 | + }); |
| 29 | + }); |
| 30 | + |
| 31 | + it('lists the suggestion source and entity types', () => { |
| 32 | + expect(SUGGESTION_SEMANTIC_SOURCE_TYPES).to.deep.equal({ TOPIC: 'topic', TITLE: 'title' }); |
| 33 | + expect(SUGGESTION_SEMANTIC_ENTITY_TYPES).to.deep.equal({ |
| 34 | + CITED_ANALYSIS: 'cited-analysis', |
| 35 | + REDDIT_ANALYSIS: 'reddit-analysis', |
| 36 | + YOUTUBE_ANALYSIS: 'youtube-analysis', |
| 37 | + }); |
| 38 | + }); |
| 39 | + |
| 40 | + it('freezes every registry', () => { |
| 41 | + [ |
| 42 | + OPPORTUNITY_SEMANTIC_SOURCE_TYPES, |
| 43 | + OPPORTUNITY_SEMANTIC_ENTITY_TYPES, |
| 44 | + SUGGESTION_SEMANTIC_SOURCE_TYPES, |
| 45 | + SUGGESTION_SEMANTIC_ENTITY_TYPES, |
| 46 | + ].forEach((registry) => expect(Object.isFrozen(registry)).to.equal(true)); |
| 47 | + }); |
| 48 | +}); |
0 commit comments