change(web): clean ContextState unit tests

Addresses these comments:
- https://github.com/keymanapp/keyman/issues/15265#issuecomment-3636890802
-   https://github.com/keymanapp/keyman/issues/15265#issuecomment-3636901217

Build-bot: skip build:web
Test-bot: skip
This commit is contained in:
Joshua Horton 2026-06-22 15:55:03 -05:00
parent e02404b365
commit 370928c8e5

View file

@ -98,14 +98,6 @@ describe('ContextState', () => {
let newContextMatch = baseState.analyzeTransition(newContext, toWrapperDistribution(transform));
assert.isNotNull(newContextMatch?.final);
assert.deepEqual(newContextMatch.final.tokenization.tokens.map(token => token.exampleInput), rawTokens);
// // Phrased this way to facilitate TS type-inference; assert.isTrue() does
// // NOT do this for us!
// if(!newContextMatch.final.tokenization.alignment.canAlign) {
// assert.fail("context alignment failed");
// }
// assert.equal(newContextMatch.final.tokenization.alignment.leadTokenShift, 0);
// assert.equal(newContextMatch.final.tokenization.alignment.tailTokenShift, 0);
});
it("properly matches and aligns when no context changes occur (after whitespace)", function() {
@ -125,14 +117,6 @@ describe('ContextState', () => {
let newContextMatch = baseState.analyzeTransition(newContext, toWrapperDistribution(transform));
assert.isNotNull(newContextMatch?.final);
assert.deepEqual(newContextMatch.final.tokenization.tokens.map(token => token.exampleInput), rawTokens);
// // Phrased this way to facilitate TS type-inference; assert.isTrue() does
// // NOT do this for us!
// if(!newContextMatch.final.tokenization.alignment.canAlign) {
// assert.fail("context alignment failed");
// }
// assert.equal(newContextMatch.final.tokenization.alignment.leadTokenShift, 0);
// assert.equal(newContextMatch.final.tokenization.alignment.tailTokenShift, 0);
});
it("properly matches and aligns when lead token is removed (end of word)", function() {
@ -437,7 +421,7 @@ describe('ContextState', () => {
});
});
describe('determineContextSlideDeltas', () => {
describe('determineContextSlideTransform', () => {
it('finds prefixed text for backward sliding context window', () => {
const before: Context = {
left: 'ples and bananas',