~hristoast/mousikofidi

871f26e5f4e82f9c3856af290c0d8350c95b89d5 — Hristos N. Triantafillou 9 months ago 09834bd
Make the link button consistent with the player versions, add tests
2 files changed, 34 insertions(+), 4 deletions(-)

M mousikofidi/templates/file_detail.html
M test_mousikofidi.py
M mousikofidi/templates/file_detail.html => mousikofidi/templates/file_detail.html +4 -1
@@ 40,8 40,11 @@
  </video>
</div>
{% endif %}

<div class="center">
  <button id="time-link" title="Click this button to have a link to this track at the current time put into your clipboard.">Get link to current time</button>
  <button id="time-link" title="Click this button to have a link to this track at the current time put into your clipboard.">
    {% if icons %}<i class="fas fa-link"></i> {% endif %}Current Time Link
  </button>
</div>

{% if comment %}

M test_mousikofidi.py => test_mousikofidi.py +30 -3
@@ 1749,10 1749,12 @@ def test_dir_detail_found(client):
    assert b"fake.flac" in rv.data
    assert b"fake.mp3" in rv.data
    assert b"fake.ogg" in rv.data
    assert b"fake.webm" in rv.data
    assert bytes("MousikóFídi Test Album", "utf8") in rv.data
    assert bytes("MousikóFídi Test Artist", "utf8") in rv.data
    assert bytes("MousikóFídi Test FLAC", "utf8") in rv.data
    assert bytes("MousikóFídi Test MP3", "utf8") in rv.data
    assert bytes("MousikóFídi Test MP4", "utf8") in rv.data
    assert bytes("MousikóFídi Test OGG", "utf8") in rv.data
    assert b"34" in rv.data
    assert (


@@ 1790,7 1792,6 @@ def test_dir_detail_found(client):
        )
        in rv.data
    )

    assert bytes('<div class="center" id="player">', "utf8") in rv.data
    assert (
        bytes(


@@ 1834,7 1835,6 @@ def test_dir_detail_found(client):
        )
        in rv.data
    )

    assert (
        bytes('<div data-nowplaying-num="0" id="video-now-playing-num"></div>', "utf8")
        in rv.data


@@ 1881,7 1881,14 @@ def test_dir_detail_found(client):
        )
        in rv.data
    )
    assert bytes('<div id="top"></div>', "utf8") in rv.data
    assert b'<div id="audio-time-link" class="center">' in rv.data
    assert (
        b'<button id="audio-time-link" title="Click this button to have a link to this track at the current time put into your clipboard.">'
        in rv.data
    )
    assert b"Current Time Link" in rv.data
    assert b'<button id="video-time-link" title="Click this button to have a link to this track at the current time put into your clipboard.">'
    assert b"Current Time Link</button>"


def test_dir_detail_not_found():


@@ 1975,6 1982,11 @@ def test_file_detail_real_flac(client):
        in rv.data
    )
    assert (
        b'<button id="time-link" title="Click this button to have a link to this track at the current time put into your clipboard.">'
        in rv.data
    )
    assert b"Current Time Link" in rv.data
    assert (
        bytes(
            '<p class="center"><span class="bold">Comment: </span>FLAC Comment!</p>',
            "utf8",


@@ 2048,6 2060,11 @@ def test_file_detail_real_mp3(client):
        in rv.data
    )
    assert (
        b'<button id="time-link" title="Click this button to have a link to this track at the current time put into your clipboard.">'
        in rv.data
    )
    assert b"Current Time Link" in rv.data
    assert (
        bytes(
            '<p class="center"><span class="bold">Comment: </span>MP3 Comment!</p>',
            "utf8",


@@ 2127,6 2144,11 @@ def test_file_detail_real_mp4(client):
        in rv.data
    )
    assert (
        b'<button id="time-link" title="Click this button to have a link to this track at the current time put into your clipboard.">'
        in rv.data
    )
    assert b"Current Time Link" in rv.data
    assert (
        bytes(
            '<p class="center"><span class="bold">Comment: </span>MP4 Comment!</p>',
            "utf8",


@@ 2200,6 2222,11 @@ def test_file_detail_real_ogg(client):
        in rv.data
    )
    assert (
        b'<button id="time-link" title="Click this button to have a link to this track at the current time put into your clipboard.">'
        in rv.data
    )
    assert b"Current Time Link" in rv.data
    assert (
        bytes(
            '<p class="center"><span class="bold">Comment: </span>OGG Comment!</p>',
            "utf8",