Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

MINOR: Fix theme extends to respect multiple image textures #2230

Merged
merged 1 commit into from
Jul 1, 2021

Conversation

germanz
Copy link
Contributor

@germanz germanz commented Jun 30, 2021

The specified allows theme extends to work properly when multiple images (textures) are specified.

@codecov
Copy link

codecov bot commented Jun 30, 2021

Codecov Report

Merging #2230 (84c4504) into master (8d70961) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2230      +/-   ##
==========================================
+ Coverage   67.29%   67.30%   +0.01%     
==========================================
  Files         312      312              
  Lines       27696    27709      +13     
  Branches     6184     6188       +4     
==========================================
+ Hits        18637    18650      +13     
  Misses       9059     9059              
Impacted Files Coverage Δ
@here/harp-mapview/lib/ThemeLoader.ts 87.50% <100.00%> (+0.69%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8d70961...84c4504. Read the comment docs.

const result = await ThemeLoader.load(inheritedTheme);
assert.exists(result.images?.foo);
assert.exists(result.images?.bar);
assert.deepEqual(result.imageTextures?.map(imageTexture => imageTexture.name).sort(), [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change one of the imageTextures to have a collision and check that the second one overrides the first one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Done.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, didn't mean to resolve.

It is better, but if I understand correctly, the test still doesn't test that the collision is resolved correctly because the "baz" points to the same image as the base theme. So you can't say for certain that you have the ImageTexture from the theme.

If you change the image:"baz" to something different (but keep the "name" the same), then you can be sure that the collision is correctly resolved.

Copy link
Member

@nzjony nzjony Jul 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, I misunderstood the code. Resolving and will approve.

Signed-off-by: German Zargaryan <2526045+germanz@users.noreply.github.com>
@germanz germanz enabled auto-merge (squash) July 1, 2021 15:01
@germanz germanz merged commit 9bff7be into master Jul 1, 2021
@germanz germanz deleted the themeExtendsImages branch July 1, 2021 15:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants