test(bot): test the LITERAL filter
This commit is contained in:
parent
e1709d8b06
commit
2101e30b8c
@ -118,7 +118,52 @@ describe("Match: ANY", () => {
|
||||
runFilterTest(filter, testCases);
|
||||
});
|
||||
|
||||
describe("Match: LITERAL", () => { });
|
||||
describe("Match: LITERAL", () => {
|
||||
const filter: prisma.Filter = {
|
||||
...templateFilter,
|
||||
name: "Block Weekly Pop Quiz",
|
||||
value: String.raw`Pop Quiz`,
|
||||
matching_algorithm: MatchingAlgorithms.EXACT,
|
||||
is_insensitive: false
|
||||
};
|
||||
|
||||
const testCases: FilterTestCase[] = [
|
||||
{
|
||||
input: "Pop Quiz 01: Win potential prizes in our first weekly pop quiz!",
|
||||
expected: true
|
||||
},
|
||||
{
|
||||
input: "The price of petrol has fallen for the first time in 5 years.",
|
||||
expected: false
|
||||
},
|
||||
{
|
||||
input: "The President's expected to deliver a speech for the easter holidays",
|
||||
expected: false
|
||||
},
|
||||
{
|
||||
input: "Pop Quiz: in todays quiz, the prizes include $1000 USD!",
|
||||
expected: true
|
||||
},
|
||||
{
|
||||
input: "The number of pop quizes at our disposoal is near infinite.",
|
||||
expected: false
|
||||
},
|
||||
{
|
||||
input: "Pop Quiz!",
|
||||
expected: true
|
||||
},
|
||||
{
|
||||
input: "There will be no Pop Quiz this week.",
|
||||
expected: true
|
||||
},
|
||||
{
|
||||
input: "There will be a pop quiz this week",
|
||||
expected: false // case sensitive
|
||||
}
|
||||
];
|
||||
|
||||
runFilterTest(filter, testCases);
|
||||
});
|
||||
|
||||
describe("Match: REGEX", () => {
|
||||
const filter: prisma.Filter = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user