Skip to content

Commit dd0b169

Browse files
committed
Fix html content loading.
refs: MBL-18561 affects: Student, Teacher release note: none test plan: - Create a global announcement. - Start apps. - Tap on the announcement on dashboard to view its contents. - Content should appear.
1 parent a43468f commit dd0b169

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

Core/Core/Common/CommonUI/SwiftUIViews/WebView.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,12 @@ public struct WebView: UIViewRepresentable {
139139
context.coordinator.loaded = source
140140
switch source {
141141
case .html(let html):
142-
webView.loadFileURL(URL.Directories.documents, allowingReadAccessTo: URL.Directories.documents)
143-
webView.loadHTMLString(html, baseURL: baseURL)
142+
webView.loadFileURL(
143+
URL.Directories.documents,
144+
allowingReadAccessTo: URL.Directories.documents
145+
) { _ in
146+
webView.loadHTMLString(html, baseURL: baseURL)
147+
}
144148
case .request(let request):
145149
webView.load(request)
146150
case nil:

Student/StudentE2ETests/Announcements/AnnouncementsTests.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,16 @@ class AnnouncementsTests: E2ETestCase {
6969
// MARK: Check visibility toggle and dismiss button of the announcement notificaiton
7070
let toggleButton = AccountNotifications.toggleButton(notification: globalAnnouncement).waitUntil(.visible)
7171
XCTAssertTrue(toggleButton.isVisible)
72+
XCTAssertEqual(toggleButton.label, "\(globalAnnouncement.subject), Tap to view announcement")
7273
var dismissButton = AccountNotifications.dismissButton(notification: globalAnnouncement).waitUntil(.vanish)
7374
XCTAssertTrue(dismissButton.isVanished)
7475

7576
// MARK: Tap the toggle button and check visibility of dismiss button again
7677
toggleButton.hit()
7778
dismissButton = dismissButton.waitUntil(.visible)
79+
XCTAssertEqual(toggleButton.label, "Hide content for \(globalAnnouncement.subject)")
7880
XCTAssertTrue(dismissButton.isVisible)
81+
XCTAssertEqual(dismissButton.label, "Dismiss \(globalAnnouncement.subject)")
7982

8083
// MARK: Check the message of the announcement
8184
let announcementMessage = Helper.notificationMessage(announcement: globalAnnouncement).waitUntil(.visible)

Teacher/TeacherE2ETests/Announcements/AnnouncementsTests.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,17 @@ class AnnouncementsTests: E2ETestCase {
7777

7878
// MARK: Check visibility toggle and dismiss button of the announcement notificaiton
7979
let toggleButton = AccountNotifications.toggleButton(notification: globalAnnouncement).waitUntil(.visible)
80-
var dismissButton = AccountNotifications.dismissButton(notification: globalAnnouncement).waitUntil(.vanish)
8180
XCTAssertTrue(toggleButton.isVisible)
81+
XCTAssertEqual(toggleButton.label, "\(globalAnnouncement.subject), Tap to view announcement")
82+
var dismissButton = AccountNotifications.dismissButton(notification: globalAnnouncement).waitUntil(.vanish)
8283
XCTAssertTrue(dismissButton.isVanished)
8384

8485
// MARK: Tap the toggle button and check visibility of dismiss button again
8586
toggleButton.hit()
8687
dismissButton = dismissButton.waitUntil(.visible)
88+
XCTAssertEqual(toggleButton.label, "Hide content for \(globalAnnouncement.subject)")
8789
XCTAssertTrue(dismissButton.isVisible)
90+
XCTAssertEqual(dismissButton.label, "Dismiss \(globalAnnouncement.subject)")
8891

8992
// MARK: Check the message of the announcement
9093
let announcementMessage = Helper.notificationMessage(announcement: globalAnnouncement).waitUntil(.visible)

0 commit comments

Comments
 (0)