UIView+SubviewsTests.swift 851 B

123456789101112131415161718192021222324252627282930
  1. //
  2. // UIView+SubviewsTests.swift
  3. // SheeeeeeeeetTests
  4. //
  5. // Created by Daniel Saidi on 2018-10-17.
  6. // Copyright © 2018 Daniel Saidi. All rights reserved.
  7. //
  8. import Quick
  9. import Nimble
  10. @testable import Sheeeeeeeeet
  11. class UIView_SubviewsTests: QuickSpec {
  12. override func spec() {
  13. describe("adding subview to fill") {
  14. it("adds subview with filling configuration") {
  15. let parent = UIView(frame: CGRect(x: 10, y: 20, width: 30, height: 40))
  16. let view = UIView(frame: .zero)
  17. parent.addSubviewToFill(view)
  18. expect(parent.subviews.count).to(equal(1))
  19. expect(parent.subviews[0]).to(be(view))
  20. expect(view.translatesAutoresizingMaskIntoConstraints).to(beFalse())
  21. }
  22. }
  23. }
  24. }