Skip to content

Commit 233ef4a

Browse files
committed
[Test] add contentInsetAdjustmentBehavior
1 parent 9399dbb commit 233ef4a

2 files changed

Lines changed: 60 additions & 0 deletions

File tree

ComposeUI/Tests/ComposeUITests/ComposeView/ComposeViewTests.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,13 @@ class ComposeViewTests: XCTestCase {
138138
expect(contentView.sizeThatFits(CGSize(width: 10, height: 10))) == CGSize(width: 10, height: 30)
139139
expect(contentView.sizeThatFits(CGSize(width: 50, height: 50))) == CGSize(width: 50, height: 30)
140140
}
141+
142+
func test_contentInsetAdjustmentBehavior() {
143+
#if canImport(AppKit)
144+
expect(contentView.automaticallyAdjustsContentInsets) == false
145+
#endif
146+
#if canImport(UIKit)
147+
expect(contentView.contentInsetAdjustmentBehavior) == .never
148+
#endif
149+
}
141150
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
//
2+
// BaseTextViewTests.swift
3+
// ComposéUI
4+
//
5+
// Created by Honghao Zhang on 5/25/26.
6+
// Copyright © 2024 Honghao Zhang.
7+
//
8+
// MIT License
9+
//
10+
// Copyright (c) 2024 Honghao Zhang (github.com/honghaoz)
11+
//
12+
// Permission is hereby granted, free of charge, to any person obtaining a copy
13+
// of this software and associated documentation files (the "Software"), to
14+
// deal in the Software without restriction, including without limitation the
15+
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
16+
// sell copies of the Software, and to permit persons to whom the Software is
17+
// furnished to do so, subject to the following conditions:
18+
//
19+
// The above copyright notice and this permission notice shall be included in
20+
// all copies or substantial portions of the Software.
21+
//
22+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27+
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
28+
// IN THE SOFTWARE.
29+
//
30+
31+
#if canImport(AppKit)
32+
import AppKit
33+
#endif
34+
35+
#if canImport(UIKit)
36+
import UIKit
37+
#endif
38+
39+
import ChouTiTest
40+
41+
import ComposeUI
42+
43+
class BaseTextViewTests: XCTestCase {
44+
45+
#if canImport(UIKit)
46+
func test_contentInsetAdjustmentBehavior() {
47+
let textView = BaseTextView(frame: .zero)
48+
expect(textView.contentInsetAdjustmentBehavior) == .never
49+
}
50+
#endif
51+
}

0 commit comments

Comments
 (0)