Skip to content

Commit 8046ae2

Browse files
Update InsertStudioOpenInDetailButtonsTests.swift
1 parent 643678b commit 8046ae2

File tree

1 file changed

+1
-42
lines changed

1 file changed

+1
-42
lines changed

Core/CoreTests/Common/CommonUI/CoreWebView/Model/Features/InsertStudioOpenDetailViewButtonTests.swift renamed to Core/CoreTests/Common/CommonUI/CoreWebView/Model/Features/InsertStudioOpenInDetailButtonsTests.swift

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import Core
2020
import XCTest
2121

22-
class InsertStudioOpenDetailViewButtonTests: XCTestCase {
22+
class InsertStudioOpenInDetailButtonsTests: XCTestCase {
2323

2424
func testInsertion() {
2525
let mockLinkDelegate = MockCoreWebViewLinkDelegate()
@@ -90,45 +90,4 @@ class InsertStudioOpenDetailViewButtonTests: XCTestCase {
9090

9191
wait(for: [exp])
9292
}
93-
94-
func testFontSizeCSSProperty() {
95-
let mockLinkDelegate = MockCoreWebViewLinkDelegate()
96-
let webView = CoreWebView(features: [.insertStudioOpenInDetailButtons])
97-
webView.linkDelegate = mockLinkDelegate
98-
webView.loadHTMLString("<div>Test</div>")
99-
wait(for: [mockLinkDelegate.navigationFinishedExpectation], timeout: 10)
100-
101-
let expectedFontSize = UIFont.scaledNamedFont(.regular14).pointSize
102-
103-
let jsEvaluated = expectation(description: "JS evaluated")
104-
105-
let extractCSSScript = """
106-
(function() {
107-
const styles = document.head.querySelectorAll('style');
108-
for (let style of styles) {
109-
const css = style.innerHTML;
110-
if (css.includes('open_details_button')) {
111-
const match = css.match(/\\.open_details_button\\s*\\{[^}]*font-size:\\s*([\\d.]+)px/);
112-
return match ? match[1] : null;
113-
}
114-
}
115-
return null;
116-
})()
117-
"""
118-
119-
webView.evaluateJavaScript(extractCSSScript) { result, error in
120-
defer { jsEvaluated.fulfill() }
121-
122-
XCTAssertNil(error)
123-
guard let fontSizeString = result as? String,
124-
let actualFontSize = Double(fontSizeString) else {
125-
XCTFail("Could not extract font-size value from CSS")
126-
return
127-
}
128-
129-
XCTAssertEqual(actualFontSize, expectedFontSize, accuracy: 0.01, "Font size in CSS should match UIFont.scaledNamedFont(.regular14).pointSize")
130-
}
131-
132-
wait(for: [jsEvaluated], timeout: 10)
133-
}
13493
}

0 commit comments

Comments
 (0)