@@ -21,7 +21,7 @@ final class PlayButtonTests: XCTestCase {
2121 windowView = vc. view
2222
2323 SnapshotTesting . diffTool = " ksdiff "
24- // isRecording = true
24+ // isRecording = true
2525 }
2626
2727 func testPlayToPause( ) {
@@ -225,6 +225,60 @@ final class PlayButtonTests: XCTestCase {
225225 button. setStop ( true , animated: false )
226226 XCTAssertEqual ( button. isStop, true )
227227 }
228+
229+ func testScaleAspectFillWidthGreaterThanHeight( ) {
230+ let button = PlayButton ( frame: CGRect ( x: 0 , y: 0 , width: 60 , height: 30 ) )
231+ button. backgroundColor = . blue
232+ button. contentMode = . scaleAspectFill
233+
234+ windowView. addSubview ( button)
235+ assertSnapshot ( matching: button, as: . image)
236+ }
237+
238+ func testScaleAspectFillHeightGreaterThanWidth( ) {
239+ let button = PlayButton ( frame: CGRect ( x: 0 , y: 0 , width: 30 , height: 60 ) )
240+ button. backgroundColor = . blue
241+ button. contentMode = . scaleAspectFill
242+
243+ windowView. addSubview ( button)
244+ assertSnapshot ( matching: button, as: . image)
245+ }
246+
247+ func testScaleAspectFitWidthGreaterThanHeight( ) {
248+ let button = PlayButton ( frame: CGRect ( x: 0 , y: 0 , width: 60 , height: 30 ) )
249+ button. backgroundColor = . blue
250+ button. contentMode = . scaleAspectFit
251+
252+ windowView. addSubview ( button)
253+ assertSnapshot ( matching: button, as: . image)
254+ }
255+
256+ func testScaleAspectFitHeightGreaterThanWidth( ) {
257+ let button = PlayButton ( frame: CGRect ( x: 0 , y: 0 , width: 30 , height: 60 ) )
258+ button. backgroundColor = . blue
259+ button. contentMode = . scaleAspectFit
260+
261+ windowView. addSubview ( button)
262+ assertSnapshot ( matching: button, as: . image)
263+ }
264+
265+ func testScaleToFillWidthGreaterThanHeight( ) {
266+ let button = PlayButton ( frame: CGRect ( x: 0 , y: 0 , width: 60 , height: 30 ) )
267+ button. backgroundColor = . blue
268+ button. contentMode = . scaleToFill
269+
270+ windowView. addSubview ( button)
271+ assertSnapshot ( matching: button, as: . image)
272+ }
273+
274+ func testScaleToFillHeightGreaterThanWidth( ) {
275+ let button = PlayButton ( frame: CGRect ( x: 0 , y: 0 , width: 30 , height: 60 ) )
276+ button. backgroundColor = . blue
277+ button. contentMode = . scaleToFill
278+
279+ windowView. addSubview ( button)
280+ assertSnapshot ( matching: button, as: . image)
281+ }
228282}
229283
230284private enum CompletionCondition {
0 commit comments