Skip to content

Commit 7e2a7cf

Browse files
committed
fix documentation comments typo and refactor tests
1 parent 6161611 commit 7e2a7cf

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

Sources/YCoreUI/Components/Elevation.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88

99
import UIKit
1010

11-
/// Encapsulate design shadows and apply them to view.
11+
/// Encapsulates design shadows and apply them to view.
1212
public struct Elevation {
1313
/// The offset of the layer’s shadow.
1414
public let offset: CGSize
15-
/// The blur of the layer's. shadow.
15+
/// The blur of the layer's shadow.
1616
public let blur: CGFloat
1717
/// The spread of the layer's shadow.
1818
public let spread: CGFloat
@@ -50,7 +50,7 @@ public struct Elevation {
5050
/// Applies elevation to a layer.
5151
/// - Parameters:
5252
/// - layer: layer of the corresponding view
53-
/// - cornerRadius: the radius to use when drawing rounded corners for the layer’s background.
53+
/// - cornerRadius: the radius to use when drawing rounded corners for the layer’s background
5454
public func apply(layer: CALayer, cornerRadius: CGFloat) {
5555
applyShadow(layer: layer)
5656

Tests/YCoreUITests/Components/ElevationTests.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,17 @@ final class ElevationTests: XCTestCase {
3333
XCTAssertEqual(sut.useShadowPath, true)
3434
}
3535

36-
func test_apply_doesNotAddShadowPathWhenUseShadowPathIsFalse() {
36+
func test_apply_doesNotsetShadowPathWhenUseShadowPathIsFalse() {
3737
let sut = makeSUT(useShadowPath: false)
38-
3938
let layer = CALayer()
4039

4140
sut.apply(layer: layer, cornerRadius: 8)
4241

4342
XCTAssertNil(layer.shadowPath)
4443
}
4544

46-
func test_apply_addsShadowPathWhenUseShadowPathIsTrue() {
45+
func test_apply_setsShadowPathWhenUseShadowPathIsTrue() {
4746
let sut = makeSUT(useShadowPath: true)
48-
4947
let layer = CALayer()
5048

5149
sut.apply(layer: layer, cornerRadius: 8)
@@ -55,7 +53,6 @@ final class ElevationTests: XCTestCase {
5553

5654
func test_apply_setsShadowPropertiesWhenUseShadowPathIsFalse() {
5755
let sut = makeSUT(useShadowPath: false)
58-
5956
let layer = CALayer()
6057

6158
sut.apply(layer: layer, cornerRadius: 8)
@@ -68,7 +65,6 @@ final class ElevationTests: XCTestCase {
6865

6966
func test_apply_setsShadowPropertiesWhenUseShadowPathIsTrue() {
7067
let sut = makeSUT(useShadowPath: true)
71-
7268
let layer = CALayer()
7369

7470
sut.apply(layer: layer, cornerRadius: 8)

0 commit comments

Comments
 (0)