This PR adds to the sparkles background effect a default value of 120 for the bpm. It is the only background effect whose draw function passes bpm as a parameter. The new 'preview' feature that will be added by https://github.com/code-dot-org/code-dot-org/pull/53817 calls on the draw nativeAPI function but does not load the selected song. Thus, we need to provide a default bpm value when the sparkles background effect is called on in preview mode.
There was a testBackground test failure for 'sparkles' after I added the default bpm value to the 'sparkle' draw function because the expected value for the test is 0. The test image is expecting a bpm value of 0. See this commit which confirms this.
I deleted the current 'sparkles' baseline image, and a new one was created based on this logic that will be used for subsequent tests - test is now passing.
Here's a screencast video AFTER the update of the 'sparkles' background effect displayed in preview mode.
This PR adds to the sparkles background effect a default value of 120 for the
bpm
. It is the only background effect whosedraw
function passesbpm
as a parameter. The new 'preview' feature that will be added by https://github.com/code-dot-org/code-dot-org/pull/53817 calls on thedraw
nativeAPI function but does not load the selected song. Thus, we need to provide a defaultbpm
value when the sparkles background effect is called on in preview mode.There was a
testBackground
test failure for 'sparkles' after I added the defaultbpm
value to the 'sparkle' draw function because the expected value for the test is 0. The test image is expecting abpm
value of 0. See this commit which confirms this. I deleted the current 'sparkles' baseline image, and a new one was created based on this logic that will be used for subsequent tests - test is now passing.Here's a screencast video AFTER the update of the 'sparkles' background effect displayed in preview mode.
https://github.com/code-dot-org/dance-party/assets/107423305/05204f3a-8aee-418f-918e-e57633191f23