File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Tests/YCoreUITests/Components Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -33,10 +33,11 @@ struct Elevation {
3333 self . useShadowPath = useShadowPath
3434 }
3535
36- func apply( layer: CALayer ) {
36+ func apply( layer: CALayer , cornerRadius : CGFloat ) {
3737 guard useShadowPath else { return }
3838
39- layer. shadowPath = UIBezierPath ( ) . cgPath
39+ let rect = layer. bounds. insetBy ( dx: - spread, dy: - spread)
40+ layer. shadowPath = UIBezierPath ( roundedRect: rect, cornerRadius: cornerRadius) . cgPath
4041 }
4142}
4243
@@ -69,7 +70,7 @@ final class ElevationTests: XCTestCase {
6970
7071 let layer = CALayer ( )
7172
72- sut. apply ( layer: layer)
73+ sut. apply ( layer: layer, cornerRadius : 8 )
7374
7475 XCTAssertNil ( layer. shadowPath)
7576 }
@@ -79,11 +80,13 @@ final class ElevationTests: XCTestCase {
7980
8081 let layer = CALayer ( )
8182
82- sut. apply ( layer: layer)
83+ sut. apply ( layer: layer, cornerRadius : 8 )
8384
8485 XCTAssertNotNil ( layer. shadowPath)
8586 }
86-
87+ }
88+
89+ private extension ElevationTests {
8790 func makeSUT( offset: CGSize = CGSize ( width: 1 , height: 1 ) ,
8891 blur: CGFloat = 2 ,
8992 spread: CGFloat = 3 ,
You can’t perform that action at this time.
0 commit comments