Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanVukovic99 committed Dec 29, 2023
1 parent 79b02b1 commit b5ea86f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
15 changes: 14 additions & 1 deletion ext/js/data/options-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,8 @@ export class OptionsUtil {
this._updateVersion19,
this._updateVersion20,
this._updateVersion21,
this._updateVersion22
this._updateVersion22,
this._updateVersion23
];
if (typeof targetVersion === 'number' && targetVersion < result.length) {
result.splice(targetVersion);
Expand Down Expand Up @@ -1144,6 +1145,18 @@ export class OptionsUtil {
return options;
}

/**
* - Added translation.partsOfSpeechFilter.
* @type {import('options-util').UpdateFunction}
*/
_updateVersion23(options) {
for (const {options: profileOptions} of options.profiles) {
profileOptions.translation.partsOfSpeechFilter = true;
}

return options;
}

/**
* @param {string} url
* @returns {Promise<chrome.tabs.Tab>}
Expand Down
2 changes: 1 addition & 1 deletion ext/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -1524,7 +1524,7 @@ <h1>Yomitan Settings</h1>
</div>
<div class="settings-item-description">
<p>
Filter algorithm deinflections using part of speech tags.
Dictionary entries will be filtered out if their PoS doesn't match the PoS expected by the deinflector.
</p>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion test/options-util.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ function createProfileOptionsUpdatedTestData1() {
convertHiraganaToKatakana: 'false',
convertKatakanaToHiragana: 'variant',
collapseEmphaticSequences: 'false',
partsOfSpeechFilter: true,
searchResolution: 'letter',
textReplacements: {
searchOriginal: true,
Expand Down Expand Up @@ -602,7 +603,7 @@ function createOptionsUpdatedTestData1() {
}
],
profileCurrent: 0,
version: 22,
version: 23,
global: {
database: {
prefixWildcardsSupported: false
Expand Down

0 comments on commit b5ea86f

Please sign in to comment.