@@ -106,7 +106,6 @@ describe('collectState', () => {
106106 loadScript ( {
107107 bodyHtml : `
108108 <input type="checkbox" id="filter-imp-high" checked>
109- <input type="checkbox" id="filter-ft-dll" checked>
110109 <input type="text" id="filter-search" value="test">
111110 <input type="checkbox" id="chk-real" checked>
112111 ` ,
@@ -115,7 +114,6 @@ describe('collectState', () => {
115114
116115 const state = window . collectState ( ) ;
117116 expect ( state ) . not . toHaveProperty ( 'filter-imp-high' ) ;
118- expect ( state ) . not . toHaveProperty ( 'filter-ft-dll' ) ;
119117 expect ( state ) . not . toHaveProperty ( 'filter-search' ) ;
120118 expect ( state [ 'chk-real' ] ) . toBe ( true ) ;
121119 } ) ;
@@ -162,57 +160,20 @@ describe('autoSave', () => {
162160 } ) ;
163161} ) ;
164162
165- // ─── getFileTypeCategory ─────────────────────────────────────────────────────
166- describe ( 'getFileTypeCategory' , ( ) => {
167- beforeEach ( ( ) => loadScript ( ) ) ;
168-
169- const cases = [
170- [ '.dll' , 'dll' ] ,
171- [ '.DLL' , 'dll' ] ,
172- [ '.exe' , 'exe' ] ,
173- [ '.EXE' , 'exe' ] ,
174- [ '.json' , 'config' ] ,
175- [ '.xml' , 'config' ] ,
176- [ '.config' , 'config' ] ,
177- [ '.yaml' , 'config' ] ,
178- [ '.yml' , 'config' ] ,
179- [ '.csproj' , 'config' ] ,
180- [ '.sln' , 'config' ] ,
181- [ '.resx' , 'resource' ] ,
182- [ '.png' , 'resource' ] ,
183- [ '.ico' , 'resource' ] ,
184- [ '.ttf' , 'resource' ] ,
185- [ '.txt' , 'other' ] ,
186- [ '.cs' , 'other' ] ,
187- [ '' , 'other' ] ,
188- [ null , 'other' ] ,
189- [ undefined , 'other' ] ,
190- ] ;
191-
192- test . each ( cases ) ( 'getFileTypeCategory(%s) returns %s' , ( ext , expected ) => {
193- expect ( window . getFileTypeCategory ( ext ) ) . toBe ( expected ) ;
194- } ) ;
195- } ) ;
196-
197163// ─── applyFilters ────────────────────────────────────────────────────────────
198164describe ( 'applyFilters' , ( ) => {
199165 function loadFilterEnv ( rows ) {
200166 const filterBar = `
201167 <input type="checkbox" id="filter-imp-high" checked>
202168 <input type="checkbox" id="filter-imp-medium" checked>
203169 <input type="checkbox" id="filter-imp-low" checked>
204- <input type="checkbox" id="filter-ft-dll" checked>
205- <input type="checkbox" id="filter-ft-exe" checked>
206- <input type="checkbox" id="filter-ft-config" checked>
207- <input type="checkbox" id="filter-ft-resource" checked>
208- <input type="checkbox" id="filter-ft-other" checked>
209170 <input type="checkbox" id="filter-unchecked">
210171 <input type="text" id="filter-search" value="">
211172 <span id="save-status"></span>
212173 ` ;
213174
214175 const tableRows = rows . map ( r =>
215- `<tr data-section="${ r . section } " data-ext=" ${ r . ext } " ${ r . importance ? 'data-importance ="' + r . importance + '"' : '' } >
176+ `<tr data-section="${ r . section } " ${ r . importance ? ' data-importance="' + r . importance + '"' : '' } ${ r . diff ? 'data-diff ="' + r . diff + '"' : '' } >
216177 <td><input type="checkbox" id="chk-${ r . id } " ${ r . checked ? 'checked' : '' } ></td>
217178 <td><span class="path-text">${ r . path } </span></td>
218179 </tr>`
@@ -224,26 +185,10 @@ describe('applyFilters', () => {
224185 fireDOMContentLoaded ( ) ;
225186 }
226187
227- test ( 'hides rows by file type when filter unchecked' , ( ) => {
228- loadFilterEnv ( [
229- { id : '1' , section : 'modified' , ext : '.dll' , path : 'lib/a.dll' } ,
230- { id : '2' , section : 'modified' , ext : '.exe' , path : 'bin/b.exe' } ,
231- { id : '3' , section : 'modified' , ext : '.json' , path : 'cfg/c.json' } ,
232- ] ) ;
233-
234- document . getElementById ( 'filter-ft-dll' ) . checked = false ;
235- window . applyFilters ( ) ;
236-
237- const rows = document . querySelectorAll ( 'tr[data-section]' ) ;
238- expect ( rows [ 0 ] . classList . contains ( 'filter-hidden' ) ) . toBe ( true ) ;
239- expect ( rows [ 1 ] . classList . contains ( 'filter-hidden' ) ) . toBe ( false ) ;
240- expect ( rows [ 2 ] . classList . contains ( 'filter-hidden' ) ) . toBe ( false ) ;
241- } ) ;
242-
243188 test ( 'hides rows by importance when filter unchecked' , ( ) => {
244189 loadFilterEnv ( [
245- { id : '1' , section : 'modified' , ext : '.dll' , importance : 'High' , path : 'a.dll' } ,
246- { id : '2' , section : 'modified' , ext : '.dll' , importance : 'Low' , path : 'b.dll' } ,
190+ { id : '1' , section : 'modified' , importance : 'High' , path : 'a.dll' } ,
191+ { id : '2' , section : 'modified' , importance : 'Low' , path : 'b.dll' } ,
247192 ] ) ;
248193
249194 document . getElementById ( 'filter-imp-low' ) . checked = false ;
@@ -256,7 +201,7 @@ describe('applyFilters', () => {
256201
257202 test ( 'importance filter does not hide rows without data-importance' , ( ) => {
258203 loadFilterEnv ( [
259- { id : '1' , section : 'unchanged' , ext : '.dll' , path : 'unchanged.dll' } ,
204+ { id : '1' , section : 'unchanged' , path : 'unchanged.dll' } ,
260205 ] ) ;
261206
262207 // Uncheck all importance filters
@@ -272,8 +217,8 @@ describe('applyFilters', () => {
272217
273218 test ( 'filters by search text against path (case-insensitive)' , ( ) => {
274219 loadFilterEnv ( [
275- { id : '1' , section : 'modified' , ext : '.dll' , path : 'src/MyApp.dll' } ,
276- { id : '2' , section : 'modified' , ext : '.dll' , path : 'src/Other.dll' } ,
220+ { id : '1' , section : 'modified' , path : 'src/MyApp.dll' } ,
221+ { id : '2' , section : 'modified' , path : 'src/Other.dll' } ,
277222 ] ) ;
278223
279224 document . getElementById ( 'filter-search' ) . value = 'myapp' ;
@@ -286,8 +231,8 @@ describe('applyFilters', () => {
286231
287232 test ( 'unchecked-only filter shows only unchecked rows' , ( ) => {
288233 loadFilterEnv ( [
289- { id : '1' , section : 'modified' , ext : '.dll' , path : 'a.dll' , checked : true } ,
290- { id : '2' , section : 'modified' , ext : '.dll' , path : 'b.dll' , checked : false } ,
234+ { id : '1' , section : 'modified' , path : 'a.dll' , checked : true } ,
235+ { id : '2' , section : 'modified' , path : 'b.dll' , checked : false } ,
291236 ] ) ;
292237
293238 document . getElementById ( 'filter-unchecked' ) . checked = true ;
@@ -304,16 +249,11 @@ describe('applyFilters', () => {
304249 <input type="checkbox" id="filter-imp-high" checked>
305250 <input type="checkbox" id="filter-imp-medium" checked>
306251 <input type="checkbox" id="filter-imp-low" checked>
307- <input type="checkbox" id="filter-ft-dll" checked>
308- <input type="checkbox" id="filter-ft-exe" checked>
309- <input type="checkbox" id="filter-ft-config" checked>
310- <input type="checkbox" id="filter-ft-resource" checked>
311- <input type="checkbox" id="filter-ft-other">
312252 <input type="checkbox" id="filter-unchecked">
313253 <input type="text" id="filter-search">
314254 <span id="save-status"></span>
315255 <table><tbody>
316- <tr data-section="modified" data-ext=".txt" ><td><span class="path-text">readme.txt</span></td></tr>
256+ <tr data-section="modified"><td><span class="path-text">readme.txt</span></td></tr>
317257 <tr class="diff-row"><td>diff content here</td></tr>
318258 </tbody></table>
319259 ` ,
@@ -328,9 +268,9 @@ describe('applyFilters', () => {
328268
329269 test ( 'when all filters checked, no rows are hidden' , ( ) => {
330270 loadFilterEnv ( [
331- { id : '1' , section : 'modified' , ext : '.dll' , importance : 'High' , path : 'a.dll' } ,
332- { id : '2' , section : 'modified' , ext : '.exe' , importance : 'Low' , path : 'b.exe' } ,
333- { id : '3' , section : 'unchanged' , ext : '.json' , path : 'c.json' } ,
271+ { id : '1' , section : 'modified' , importance : 'High' , path : 'a.dll' } ,
272+ { id : '2' , section : 'modified' , importance : 'Low' , path : 'b.exe' } ,
273+ { id : '3' , section : 'unchanged' , path : 'c.json' } ,
334274 ] ) ;
335275
336276 window . applyFilters ( ) ;
@@ -348,11 +288,6 @@ describe('resetFilters', () => {
348288 <input type="checkbox" id="filter-imp-high">
349289 <input type="checkbox" id="filter-imp-medium" checked>
350290 <input type="checkbox" id="filter-imp-low" checked>
351- <input type="checkbox" id="filter-ft-dll">
352- <input type="checkbox" id="filter-ft-exe" checked>
353- <input type="checkbox" id="filter-ft-config" checked>
354- <input type="checkbox" id="filter-ft-resource" checked>
355- <input type="checkbox" id="filter-ft-other" checked>
356291 <input type="checkbox" id="filter-unchecked" checked>
357292 <input type="text" id="filter-search" value="some query">
358293 <span id="save-status"></span>
@@ -363,7 +298,6 @@ describe('resetFilters', () => {
363298 window . resetFilters ( ) ;
364299
365300 expect ( document . getElementById ( 'filter-imp-high' ) . checked ) . toBe ( true ) ;
366- expect ( document . getElementById ( 'filter-ft-dll' ) . checked ) . toBe ( true ) ;
367301 expect ( document . getElementById ( 'filter-unchecked' ) . checked ) . toBe ( false ) ;
368302 expect ( document . getElementById ( 'filter-search' ) . value ) . toBe ( '' ) ;
369303 } ) ;
0 commit comments