Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
fix: fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
saeedbashir committed Aug 25, 2023
1 parent 902ea63 commit cdd4549
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Test/DiscoveryHelperTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import XCTest
@testable import edX

private let sampleInvalidProgramDetailURL = "//course_info?path_id=course/usmx-corporate-finance"
private let sampleInvalidProgramDetailURL = "//course_info?path_id=usmx-corporate-finance"
private let sampleEnrolledProgramDetailURL = "edxapp://enrolled_program_info?path_id=programs/a3951294-926b-4247-8c3c-51c1e4347a15/details_fragment"
private let sampleEnrolledCourseDetailURL = "edxapp://enrolled_course_info?course_id=course-v1:USMx+BUMM612+2T2018"
private let sampleProgramCourseURL = "edxapp://course_info?path_id=usmx-corporate-finance"
Expand Down
6 changes: 3 additions & 3 deletions Test/OEXFindCoursesTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,17 @@ -(void)testFindCoursesURLRecognition{
RouterEnvironment *environment = [self mockRouterEnvironment];
DiscoveryWebViewHelper* helper = [[DiscoveryWebViewHelper alloc] initWithEnvironment:environment delegate:nil bottomBar:nil searchQuery:nil];
OEXFindCoursesViewController *findCoursesViewController = [[OEXFindCoursesViewController alloc] init];
NSURLRequest *testURLRequestCorrect = [NSURLRequest requestWithURL:[NSURL URLWithString:@"edxapp://course_info?path_id=course/science-happiness-uc-berkeleyx-gg101x"]];
NSURLRequest *testURLRequestCorrect = [NSURLRequest requestWithURL:[NSURL URLWithString:@"edxapp://course_info?path_id=science-happiness-uc-berkeleyx-gg101x"]];
BOOL successCorrect = ![findCoursesViewController webView:helper.t_webView shouldLoad:testURLRequestCorrect];
XCTAssert(successCorrect, @"Correct URL not recognized");

NSURLRequest *testURLRequestWrong = [NSURLRequest requestWithURL:[NSURL URLWithString:@"edxapps://course_infos?path_id=course/science-happiness-uc-berkeleyx-gg101x"]];
NSURLRequest *testURLRequestWrong = [NSURLRequest requestWithURL:[NSURL URLWithString:@"edxapps://course_infos?path_id=science-happiness-uc-berkeleyx-gg101x"]];
BOOL successWrong = [findCoursesViewController webView:helper.t_webView shouldLoad:testURLRequestWrong];
XCTAssert(successWrong, @"Wrong URL not recognized");
}

-(void)testPathIDParsing{
NSURL *testURL = [NSURL URLWithString:@"edxapp://course_info?path_id=course/science-happiness-uc-berkeleyx-gg101x"];
NSURL *testURL = [NSURL URLWithString:@"edxapp://course_info?path_id=science-happiness-uc-berkeleyx-gg101x"];
OEXFindCoursesViewController *findCoursesViewController = [[OEXFindCoursesViewController alloc] init];

NSString *pathID = [findCoursesViewController getCoursePathIDFromURL:testURL];
Expand Down

0 comments on commit cdd4549

Please sign in to comment.