Merge develop into feature/50-upload-soundtrack
The API spec is now formatted like before (2-space indents, sorted keys): develop's spec with the upload paths and types added, so the diff to develop is only the upload API. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
8263781abc
20 files changed
+5661
-45
No files matched your search
@@ -0,0 +1,88 @@
|
||||
extends GdUnitTestSuite
|
||||
## The sync popup's progress bar: busy until there is progress, gliding to new values,
|
||||
## a highlight on the filled part, and plain jumps with Reduce animations.
|
||||
|
||||
var _runner: GdUnitSceneRunner
|
||||
var _bar: AnimatedProgressBar
|
||||
var _reduce_before: bool
|
||||
|
||||
|
||||
func before_test() -> void:
|
||||
_reduce_before = Settings.reduce_animations
|
||||
Settings.reduce_animations = false
|
||||
var holder: Control = auto_free(Control.new())
|
||||
holder.size = Vector2(1000, 100)
|
||||
_bar = AnimatedProgressBar.new()
|
||||
_bar.theme_type_variation = &"SyncProgressBar"
|
||||
_bar.size = Vector2(1000, 32)
|
||||
holder.add_child(_bar)
|
||||
_runner = scene_runner(holder)
|
||||
await _runner.simulate_frames(1)
|
||||
|
||||
|
||||
func after_test() -> void:
|
||||
Settings.reduce_animations = _reduce_before
|
||||
|
||||
|
||||
func _label() -> Label:
|
||||
return _bar.get_child(1) as Label
|
||||
|
||||
|
||||
func test_waits_with_the_busy_animation() -> void:
|
||||
_bar.wait()
|
||||
|
||||
assert_bool(_bar.indeterminate).is_true()
|
||||
assert_str(_label().text).is_empty()
|
||||
|
||||
|
||||
func test_progress_ends_the_wait_and_glides() -> void:
|
||||
_bar.wait()
|
||||
|
||||
_bar.move_to(40)
|
||||
|
||||
assert_bool(_bar.indeterminate).is_false()
|
||||
assert_float(_bar.value).is_less(40.0)
|
||||
await await_millis(int(Anim.SLOW * 1000) + 150)
|
||||
assert_float(_bar.value).is_equal(40.0)
|
||||
assert_str(_label().text).is_equal("40%")
|
||||
|
||||
|
||||
func test_reduce_animations_jumps_and_never_waits() -> void:
|
||||
Settings.reduce_animations = true
|
||||
|
||||
_bar.wait()
|
||||
assert_bool(_bar.indeterminate).is_false()
|
||||
_bar.move_to(75)
|
||||
|
||||
assert_float(_bar.value).is_equal(75.0)
|
||||
assert_str(_label().text).is_equal("75%")
|
||||
|
||||
|
||||
func test_highlight_stays_on_the_filled_part() -> void:
|
||||
Settings.reduce_animations = true
|
||||
_bar.move_to(50)
|
||||
Settings.reduce_animations = false
|
||||
await _runner.simulate_frames(3)
|
||||
|
||||
var mask: Control = _bar.get_child(0)
|
||||
assert_bool(mask.visible).is_true()
|
||||
assert_float(mask.size.x).is_equal(_bar.fill_width())
|
||||
assert_float(_bar.fill_width()).is_between(490.0, 510.0)
|
||||
|
||||
|
||||
func test_no_highlight_without_progress_or_animations() -> void:
|
||||
await _runner.simulate_frames(2)
|
||||
assert_bool((_bar.get_child(0) as Control).visible).is_false()
|
||||
|
||||
Settings.reduce_animations = true
|
||||
_bar.move_to(50)
|
||||
await _runner.simulate_frames(2)
|
||||
assert_bool((_bar.get_child(0) as Control).visible).is_false()
|
||||
|
||||
|
||||
func test_highlight_takes_the_themes_colour() -> void:
|
||||
var shine: TextureRect = _bar.get_child(0).get_child(0)
|
||||
var gradient: Gradient = (shine.texture as GradientTexture2D).gradient
|
||||
|
||||
assert_object(gradient.get_color(1)).is_equal(_bar.get_theme_color(&"shine"))
|
||||
assert_float(gradient.get_color(0).a).is_equal(0.0)
|
||||
@@ -0,0 +1 @@
|
||||
uid://bgb6no4urwpc7
|
||||
@@ -118,7 +118,7 @@ func test_sync_response() -> void:
|
||||
"soundtracks_added": ["Terranigma"], "soundtracks_re_added": [],
|
||||
"soundtracks_changed_title": {"FF6": "Final Fantasy VI"},
|
||||
"soundtracks_changed_content": ["Chrono Trigger"], "soundtracks_removed": ["Old"],
|
||||
"catched_errors": ["Could not read x.mp3"], "total_time": "00:00:03"}"""))
|
||||
"catched_errors": ["Could not read x.mp3"], "total_time": "00:03"}"""))
|
||||
|
||||
assert_array(result.soundtracks_added).contains_exactly(["Terranigma"])
|
||||
assert_array(result.soundtracks_re_added).is_empty()
|
||||
@@ -126,15 +126,15 @@ func test_sync_response() -> void:
|
||||
assert_array(result.soundtracks_changed_content).contains_exactly(["Chrono Trigger"])
|
||||
assert_array(result.soundtracks_removed).contains_exactly(["Old"])
|
||||
assert_array(result.catched_errors).contains_exactly(["Could not read x.mp3"])
|
||||
assert_str(result.total_time).is_equal("00:00:03")
|
||||
assert_str(result.total_time).is_equal("00:03")
|
||||
|
||||
|
||||
func test_progress_response() -> void:
|
||||
var progress: ProgressResponse = ProgressResponse.from_dict(_parse("""{
|
||||
"progress": "40", "time_spent": "00:00:02"}"""))
|
||||
"progress": "40", "time_spent": "00:02"}"""))
|
||||
|
||||
assert_str(progress.progress).is_equal("40")
|
||||
assert_str(progress.time_spent).is_equal("00:00:02")
|
||||
assert_str(progress.time_spent).is_equal("00:02")
|
||||
|
||||
|
||||
func test_version_data() -> void:
|
||||
|
||||
Reference in new issue
Block a user