TAMULib / weaver-components

Custom Web Components for the Weaver UI
MIT License
0 stars 1 forks source link

Incorrect boolean logic in dequeue and inadequate tests #442

Closed kaladay closed 2 years ago

kaladay commented 2 years ago

The boolean logic appears incorrect to me for: https://github.com/TAMULib/weaver-components/blob/e8ee49c21d6425d10c26050df67728a6983a2598/projects/wvr-elements/src/lib/core/manifest/manifest.reducers.ts#L99

The !A && !B logic should instead be:!A || !B (or alternatively !(A && B)). Because the filter should accept non-matching manifest name OR a matching manifest name with a non-matching entry name.

The tests are not catching this for two reasons: 1) The state is not pre-populated with test data to dequeue! 2) There needs to be dequeue tests with multiple entries rather than just the matching entry.