@@ -11,7 +11,7 @@ import {
1111 hideRepeatThrow ,
1212 hideRepeatWords ,
1313} from "../moderate" ;
14- import { IParameter } from "../config" ;
14+ import { IParameterV2 } from "../config" ;
1515import { KuromojiToken } from "kuromojin" ;
1616import { IKuromojiWorker } from "../kuromoji" ;
1717
@@ -25,19 +25,19 @@ describe("moderate", () => {
2525 } ,
2626 } ;
2727
28- const params : IParameter = {
29- repeat_throw_threshold : 2 ,
30- repeat_word_threshold : 2 ,
31- post_flood_threshold : 2 ,
32- length_threshold : 3 ,
33- look_chats : 10 ,
34- execution_interval : 1000 ,
35- ng_words : [ "なう" ] ,
36- is_show_reason : false ,
37- is_activate_modekun : true ,
38- consider_author_length : false ,
39- consider_author_ngword : false ,
40- is_hide_completely : false ,
28+ const params : IParameterV2 = {
29+ repeatPostThreshold : 2 ,
30+ repeatWordThreshold : 2 ,
31+ postFrequencyThreshold : 2 ,
32+ lengthThreshold : 3 ,
33+ lookChats : 10 ,
34+ executionInterval : 1000 ,
35+ ngWords : [ "なう" ] ,
36+ isShowReason : false ,
37+ isActivateModekun : true ,
38+ considerAuthorLength : false ,
39+ considerAuthorNgWord : false ,
40+ isHideCompletely : false ,
4141 } ;
4242 describe ( "hideRepeatWords" , ( ) => {
4343 const chats : IChat [ ] = [
@@ -156,9 +156,9 @@ describe("moderate", () => {
156156 element : document . createElement ( "div" ) ,
157157 } ,
158158 ] ;
159- const param : IParameter = {
159+ const param : IParameterV2 = {
160160 ...params ,
161- consider_author_ngword : true ,
161+ considerAuthorNgWord : true ,
162162 } ;
163163 hideNgWords ( param , chats ) ;
164164 expect ( chats [ 0 ] . element . dataset . isHiddenByModekun ) . toBeFalsy ( ) ;
@@ -260,10 +260,10 @@ describe("moderate", () => {
260260 element : document . createElement ( "div" ) ,
261261 } ,
262262 ] ;
263- const param : IParameter = {
263+ const param : IParameterV2 = {
264264 ...params ,
265- length_threshold : 5 ,
266- consider_author_length : true ,
265+ lengthThreshold : 5 ,
266+ considerAuthorLength : true ,
267267 } ;
268268 hideByLength ( param , chats ) ;
269269 expect ( chats [ 0 ] . element . dataset . isHiddenByModekun ) . toBeTruthy ( ) ;
@@ -291,10 +291,10 @@ describe("moderate", () => {
291291 element : document . createElement ( "div" ) ,
292292 } ,
293293 ] ;
294- const param : IParameter = {
294+ const param : IParameterV2 = {
295295 ...params ,
296- repeat_throw_threshold : 2 ,
297- post_flood_threshold : 3 ,
296+ repeatPostThreshold : 2 ,
297+ postFrequencyThreshold : 3 ,
298298 } ;
299299 test ( "can hide by both filter" , ( ) => {
300300 hideRepeatThrow ( param , chats ) ;
@@ -317,9 +317,9 @@ describe("moderate", () => {
317317 expect ( chat . element . style . display ) . not . toBe ( "none" ) ;
318318 } ) ;
319319 test ( "can hide with display none" , ( ) => {
320- const param : IParameter = {
320+ const param : IParameterV2 = {
321321 ...params ,
322- is_hide_completely : true ,
322+ isHideCompletely : true ,
323323 } ;
324324 const chat : IChat = {
325325 key : "test1aaa" ,
@@ -332,9 +332,9 @@ describe("moderate", () => {
332332 expect ( chat . element . style . display ) . toBe ( "none" ) ;
333333 } ) ;
334334 test ( "can hide associated elements with display none" , ( ) => {
335- const param : IParameter = {
335+ const param : IParameterV2 = {
336336 ...params ,
337- is_hide_completely : true ,
337+ isHideCompletely : true ,
338338 } ;
339339 const chat : IChat = {
340340 key : "test1aaa" ,
0 commit comments