Skip to content

Commit

Permalink
Merge branch 'Simon-Initiative:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
dtiwarATS authored Nov 8, 2024
2 parents fefd7c8 + f1ae712 commit 706b11e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
29 changes: 23 additions & 6 deletions lib/oli_web/live/delivery/student/utils.ex
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ defmodule OliWeb.Delivery.Student.Utils do
</div>
</div>
</div>
<div class="justify-start items-center gap-3 inline-flex">
<div class="justify-start items-center gap-3 flex-col">
<div
:if={@page_context.page.duration_minutes}
class="opacity-50 justify-start items-center gap-1.5 flex"
Expand All @@ -93,11 +93,28 @@ defmodule OliWeb.Delivery.Student.Utils do
</div>
</div>
</div>
<div role="page schedule" class="justify-start items-start gap-1 flex">
<div
:if={@page_context.effective_settings.end_date}
class="opacity-50 dark:text-white text-xs font-normal"
>
<div
:if={@page_context.effective_settings.start_date}
role="page start schedule"
class="justify-start items-start gap-1 flex"
>
<div class="opacity-50 dark:text-white text-xs font-normal">
Available by:
</div>
<div class="dark:text-white text-xs font-normal">
<%= FormatDateTime.to_formatted_datetime(
@page_context.effective_settings.start_date,
@ctx,
"{WDshort} {Mshort} {D}, {YYYY}"
) %>
</div>
</div>
<div
:if={@page_context.effective_settings.end_date}
role="page schedule"
class="justify-start items-start gap-1 flex"
>
<div class="opacity-50 dark:text-white text-xs font-normal">
<%= label_for_scheduling_type(@page_context.effective_settings.scheduling_type) %>
</div>
<div class="dark:text-white text-xs font-normal">
Expand Down
2 changes: 2 additions & 0 deletions test/oli_web/live/delivery/student/lesson_live_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,8 @@ defmodule OliWeb.Delivery.Student.LessonLiveTest do
assert has_element?(view, ~s{div[role="page read time"]}, "15")
assert has_element?(view, ~s{div[role="page schedule"]}, "Read by:")
assert has_element?(view, ~s{div[role="page schedule"]}, "Tue Nov 14, 2023")
assert has_element?(view, ~s{div[role="page start schedule"]}, "Available by:")
assert has_element?(view, ~s{div[role="page start schedule"]}, "Fri Nov 10, 2023")
end

test "can not see page duration time when it is not set", %{
Expand Down
8 changes: 4 additions & 4 deletions test/oli_web/live/products_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -184,23 +184,23 @@ defmodule OliWeb.ProductsLiveTest do

assert view
|> element("tr:first-child > td:first-child")
|> render() =~ product.title
|> render() =~ product_2.title

assert view
|> element("tr:last-child > td:first-child")
|> render() =~ product_2.title
|> render() =~ product.title

view
|> element("th[phx-click=\"paged_table_sort\"][phx-value-sort_by=\"inserted_at\"]")
|> render_click()

assert view
|> element("tr:first-child > td:first-child")
|> render() =~ product_2.title
|> render() =~ product.title

assert view
|> element("tr:last-child > td:first-child")
|> render() =~ product.title
|> render() =~ product_2.title
end

test "include archived products", %{conn: conn, product: product} do
Expand Down

0 comments on commit 706b11e

Please sign in to comment.