Skip to content

Commit

Permalink
LMSA-9344 - added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iudsobiera committed Sep 9, 2024
1 parent f0a2447 commit 491e623
Show file tree
Hide file tree
Showing 3 changed files with 672 additions and 1,315 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ public class CrosslistControllerTest {

@BeforeEach
public void setup() {
log.info("RUNNING SETUP");
OidcAuthenticationToken token = TestUtils.buildToken(USER_ID, COURSE_ID, LTIConstants.INSTRUCTOR_AUTHORITY);
SecurityContextHolder.getContext().setAuthentication(token);

Expand All @@ -136,29 +135,6 @@ public void setup() {
Mockito.when(courseSessionService.getAttributeFromSession(any(HttpSession.class), eq(COURSE_ID), eq(OidcTokenAwareController.SESSION_TOKEN_KEY), eq(OidcAuthenticationToken.class))).thenReturn(token);
}

@Test
public void testLaunch() throws Exception {
MvcResult mvcResult = mvc.perform(get(String.format("/app/%s/main", COURSE_ID))
.header(HttpHeaders.USER_AGENT, TestUtils.defaultUseragent())
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andReturn();

String htmlResult = mvcResult.getResponse().getContentAsString();

Document document = Jsoup.parse(htmlResult);

// Document document = Jsoup.connect(url).get();
//
// Element container = document.selectFirst(".ajax-content-container");
// container = container == null ? Jsoup.parse("") : container;
//
// List<MediaCard> mediaCards = new ArrayList<>();
//
// Elements mediaCardElements = document.select(".media-card");

}

@Test
public void testEtextMissingMessageAppears() throws Exception {
final String sectionListJson =
Expand Down
Loading

0 comments on commit 491e623

Please sign in to comment.