         viewModel.bounds = bounds
 
         // Then
-        var expectedFrame = bounds
-        expectedFrame.size.width *= CGFloat(progress)
-
-        let expectedMaskLayerFrameAnimation = FrameAnimation(frame: expectedFrame,
+        let expectedMaskLayerFrameAnimation = FrameAnimation(frame: bounds.adaptedWidth(percent: progress),
                                                              duration: 0,
                                                              timingFunction: timingFunction)
 

        viewModel.setProgress(progress)

        // Then
        var expectedFrame = bounds
        expectedFrame.size.width *= CGFloat(progress)

        let expectedMaskLayerFrameAnimation = FrameAnimation(frame: expectedFrame,
                                                             duration: 0,
                                                             timingFunction: timingFunction)

        XCTAssertEqual(viewModel.maskLayerFrameAnimation.value, expectedMaskLayerFrameAnimation)
    }

    func test_setProgress_shouldUpdateMaskLayerFrameAnimation_withCorrectFrame_andTimingFunction_andDuration() {
        // Given
        let timingFunction = CAMediaTimingFunction(name: .easeInEaseOut)
        viewModel.timingFunction = timingFunction

        viewModel.setProgress(progress, animated: true)

        // Then
        let expectedMaskLayerFrameAnimation = FrameAnimation(frame: bounds.adaptedWidth(percent: progress),
                                                             duration: animationDuration,
                                                             timingFunction: timingFunction)

        XCTAssertEqual(viewModel.maskLayerFrameAnimation.value, expectedMaskLayerFrameAnimation)
    }
}

// MARK: - Helpers

private extension CGRect {
    func adaptedWidth(percent: Float) -> CGRect {
        var mutableCopy = self
        mutableCopy.size.width *= CGFloat(percent)

        return mutableCopy
    }
}
