@sinch/mcp
Version:
Sinch MCP server
36 lines • 1.84 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("../src/utils");
describe('hasMatchingTag', () => {
test('should return true when there is a common tag', () => {
const tags = ['apple 🍎', 'banana 🍌', 'orange 🍊'];
const filteringTags = ['banana 🍌', 'grape 🍇'];
expect((0, utils_1.matchesAnyTag)(tags, filteringTags)).toBeTruthy();
});
test('should return false when there are no common tags', () => {
const tags = ['apple 🍎', 'banana 🍌', 'orange 🍊'];
const filteringTags = ['grape 🍇', 'kiwi 🥝'];
expect((0, utils_1.matchesAnyTag)(tags, filteringTags)).toBeFalsy();
});
test('should return false when tags array is empty (i.e. deactivated tool)', () => {
const tags = [];
const filteringTags = ['apple 🍎', 'banana 🍌'];
expect((0, utils_1.matchesAnyTag)(tags, filteringTags)).toBeFalsy();
});
test('should return true when no filtering tag are provided (i.e. all tools are activated)', () => {
const tags = ['apple 🍎', 'banana 🍌', 'orange 🍊'];
const filteringTags = [];
expect((0, utils_1.matchesAnyTag)(tags, filteringTags)).toBeTruthy();
});
test('should match even if casing if different', () => {
const tags = ['banana 🍌'];
const filteringTags = ['BANANA 🍌'];
expect((0, utils_1.matchesAnyTag)(tags, filteringTags)).toBeTruthy();
});
test('should return true when multiple common tags exist', () => {
const tags = ['apple 🍎', 'banana 🍌', 'orange 🍊'];
const filteringTags = ['banana 🍌', 'orange 🍊', 'grape 🍇'];
expect((0, utils_1.matchesAnyTag)(tags, filteringTags)).toBeTruthy();
});
});
//# sourceMappingURL=utils.test.js.map