catalog-react: never match null in entity predicates
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -108,6 +108,7 @@ describe('evaluateEntityPredicate', () => {
|
||||
type: 'grpc',
|
||||
owner: 'g',
|
||||
definition: 'mock',
|
||||
nothing: null,
|
||||
},
|
||||
relations: [
|
||||
{
|
||||
@@ -215,6 +216,7 @@ describe('evaluateEntityPredicate', () => {
|
||||
['s,w,a', { 'spec.owner': { $exists: true } }],
|
||||
['g', { 'spec.owner': { $exists: false } }],
|
||||
['s', { 'spec.type': 'service' }],
|
||||
['', { 'spec.nothing': null }],
|
||||
['w,g,a', { $not: { 'spec.type': 'service' } }],
|
||||
['', { 'spec.type': null }],
|
||||
[
|
||||
|
||||
@@ -108,6 +108,9 @@ function valuesAreEqual(
|
||||
a: JsonValue | undefined,
|
||||
b: JsonValue | undefined,
|
||||
): boolean {
|
||||
if (a === null || b === null) {
|
||||
return false;
|
||||
}
|
||||
if (a === b) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user