diff --git a/test/expression.test.js b/test/expression.test.js index 883ea54c213..ad46463f72a 100644 --- a/test/expression.test.js +++ b/test/expression.test.js @@ -6,7 +6,6 @@ import {toString} from '../src/style-spec/expression/types'; import ignores from './ignores.json'; let tests; -const availableImages = ['monument-15']; if (process.argv[1] === __filename && process.argv.length > 2) { tests = process.argv.slice(2); @@ -14,6 +13,7 @@ if (process.argv[1] === __filename && process.argv.length > 2) { run('js', {ignores, tests}, (fixture) => { const spec = Object.assign({}, fixture.propertySpec); + let availableImages; if (!spec['property-type']) { spec['property-type'] = 'data-driven'; @@ -49,6 +49,8 @@ run('js', {ignores, tests}, (fixture) => { for (const input of fixture.inputs || []) { try { const feature = {properties: input[1].properties || {}}; + availableImages = input[0].availableImages || []; + if ('id' in input[1]) { feature.id = input[1].id; } diff --git a/test/integration/expression-tests/image/basic/test.json b/test/integration/expression-tests/image/basic/test.json index 4a08789305b..797966e7e7f 100644 --- a/test/integration/expression-tests/image/basic/test.json +++ b/test/integration/expression-tests/image/basic/test.json @@ -5,8 +5,8 @@ ], "inputs": [ [ - {}, - {} + {"availableImages": ["monument-15"]}, + {} ] ], "expected": { diff --git a/test/integration/expression-tests/image/coalesce/test.json b/test/integration/expression-tests/image/coalesce/test.json index a2d2284c24c..75f168207eb 100644 --- a/test/integration/expression-tests/image/coalesce/test.json +++ b/test/integration/expression-tests/image/coalesce/test.json @@ -4,7 +4,10 @@ "type": "resolvedImage" }, "inputs": [ - [{}, {}] + [ + {"availableImages": ["monument-15"]}, + {} + ] ], "expected": { "compiled": { diff --git a/test/integration/expression-tests/image/compound/test.json b/test/integration/expression-tests/image/compound/test.json index 31491640dae..0b2b8bbcf28 100644 --- a/test/integration/expression-tests/image/compound/test.json +++ b/test/integration/expression-tests/image/compound/test.json @@ -3,7 +3,14 @@ "image", ["get", "icon"] ], - "inputs": [[{}, {"properties": {"icon": "monument-15"}}]], + "inputs": [ + [ + {"availableImages": ["monument-15"]}, + { + "properties": {"icon": "monument-15"} + } + ] + ], "expected": { "compiled": { "result": "success",