Files
suixinkan_ios_new/suixinkanTests/MJRefreshSupportTests.swift
汉秋 8997d1ba1c 集成 MJRefresh 并重构主 TabBar 为系统 TabView 样式。
新增 SwiftUI 桥接层与单元测试,更新 Tab 图标资源命名和多倍图,同步调整 UI Test 的 Tab/扫码定位逻辑。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 10:22:53 +08:00

39 lines
1.3 KiB
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// MJRefreshSupportTests.swift
// suixinkanTests
//
// Created by Codex on 2026/6/26.
//
import XCTest
@testable import suixinkan
/// MJRefresh SwiftUI
final class MJRefreshSupportTests: XCTestCase {
/// UIScrollView
func testEnclosingScrollViewFindsParentScrollView() {
let scrollView = UIScrollView(frame: CGRect(x: 0, y: 0, width: 320, height: 480))
let container = UIView(frame: scrollView.bounds)
let anchor = UIView(frame: .zero)
scrollView.addSubview(container)
container.addSubview(anchor)
XCTAssertIdentical(anchor.enclosingScrollView, scrollView)
}
/// ScrollView nil
func testEnclosingScrollViewReturnsNilWithoutScrollView() {
let view = UIView(frame: .zero)
XCTAssertNil(view.enclosingScrollView)
}
}
extension MJRefreshSupportTests {
///
fileprivate func XCTAssertIdentical(_ expression1: AnyObject?, _ expression2: AnyObject?, file: StaticString = #filePath, line: UInt = #line) {
if expression1 !== expression2 {
XCTFail("Expected identical objects", file: file, line: line)
}
}
}