Skip to content

Commit

Permalink
Remove system tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aidewoode committed Oct 8, 2024
1 parent a79de7b commit 3c5c272
Show file tree
Hide file tree
Showing 34 changed files with 39 additions and 780 deletions.
2 changes: 1 addition & 1 deletion app/views/albums/_album.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class='o-grid__item c-card u-mb-medium' data-test-id='album_card'>
<div class='o-grid__item c-card u-mb-medium'>
<%= link_to album_path(album), class: "c-card__image" do %>
<%= cover_image_tag album, class: "u-image-fluid" %>
<% end %>
Expand Down
8 changes: 4 additions & 4 deletions app/views/albums/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<div class='o-container o-container--narrow' data-controller='songs songs-bridge album-bridge' data-album-bridge-id-value='<%= @album.id %>'>
<div class='c-card c-card--horizontal c-card--center@narrow u-my-large'>
<%= cover_image_tag @album, class: "c-card__image u-image-medium", data: {"test-id" => "album_image"} %>
<%= cover_image_tag @album, class: "c-card__image u-image-medium" %>
<div class='c-card__body'>
<h1 class='c-card__body__title'><%= @album.name %></h1>
<%= link_to @album.artist.name, artist_path(@album.artist), class: "c-card__body__text" %>
Expand Down Expand Up @@ -39,7 +39,7 @@
<% end %>
<% songs.each do |song| %>
<li class='c-list__item' data-songs-target='item' data-song-id='<%= song.id %>' data-test-id='album_song'>
<li class='c-list__item' data-songs-target='item' data-song-id='<%= song.id %>'>
<div class='o-flex o-flex--justify-between o-flex--align-center'>
<%= button_to(
current_playlist_album_path(@album, should_play: true, song_id: song.id),
Expand All @@ -56,7 +56,7 @@
) do %>
<div class='o-flex o-flex--justify-between o-flex--align-center'>
<div>
<div data-test-id='album_song_name'><%= song.name %></div>
<div><%= song.name %></div>
<% if @album.artist.various? %>
<% if native_app? %>
<span class='c-list__item__subtext'><%= song.artist.name %></span>
Expand All @@ -69,7 +69,7 @@
</div>
<% end %>

<details class='c-dropdown' data-test-id='album_song_menu' data-controller='dropdown'>
<details class='c-dropdown' data-controller='dropdown'>
<summary class="c-button c-button--icon">
<%= icon_tag "more-vertical", size: "small", title: t("label.more") %>
</summary>
Expand Down
2 changes: 1 addition & 1 deletion app/views/artists/_artist.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class='o-grid__item c-card u-mb-medium' data-test-id='artist_card'>
<div class='o-grid__item c-card u-mb-medium'>
<%= link_to artist_path(artist), class: "c-card__image" do %>
<%= cover_image_tag artist, class: "u-image-fluid" %>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/artists/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<div class='o-container o-container--wide'>
<div class='c-card c-card--horizontal c-card--center@narrow u-my-large'>
<%= cover_image_tag @artist, class: "c-card__image u-image-medium", data: {"test-id" => "artist_image"} %>
<%= cover_image_tag @artist, class: "c-card__image u-image-medium" %>
<div class='c-card__body'>
<h1 class='c-card__body__title'><%= @artist.name %></h1>
<div class='c-card__body__text'>
Expand Down
9 changes: 4 additions & 5 deletions app/views/current_playlist/songs/_song.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,24 @@
data-song-id='<%= song.id %>'
data-song-json='<%= song_json_builder(song).target! %>'
data-should-play='<%= local_assigns[:should_play] ? should_play : false %>'
draggable='true'
data-test-id='current_playlist_song'>
draggable='true'>

<div class='o-flex o-flex--align-center u-py-narrow'>
<% unless mobile? %>
<button class='c-button c-button--icon js-playlist-sortable-item-handle u-mr-narrow' data-test-id='playlist_song_sortable_handle'><%= icon_tag "drag-indicator", size: "small" %></button>
<button class='c-button c-button--icon js-playlist-sortable-item-handle u-mr-narrow'><%= icon_tag "drag-indicator", size: "small" %></button>
<% end %>

<button class='c-button c-button--link o-flex__item--grow-1' data-delegated-action='click->current-playlist-songs#play'>
<div class='o-flex o-flex--justify-between o-flex--align-center'>
<div class='u-mr-narrow'>
<span class='u-text-line-clamp-2' data-test-id='current_playlist_song_name'><%= song.name %></span>
<span class='u-text-line-clamp-2'><%= song.name %></span>
<%= link_to song.artist.name, artist_path(song.artist), class: "c-list__item__subtext", data: {"turbo-frame" => "_top", "prevent-delegation" => true} %>
</div>
<div class='u-text-monospace u-mr-narrow'><%= format_duration(song.duration) %></div>
</div>
</button>

<details class='c-dropdown' data-controller="dropdown" data-test-id='current_playlist_song_menu'>
<details class='c-dropdown' data-controller="dropdown">
<summary class="c-button c-button--icon" role="button"><%= icon_tag "more-vertical", size: "small", title: t("label.more") %></summary>
<div class='c-dropdown__menu' data-dropdown-target="menu">
<%= link_to t("label.add_to_playlist"), dialog_playlists_path(song_id: song.id, referer_url: current_url), data: {"turbo-frame" => ("turbo-dialog" unless native_app?)}, class: "c-dropdown__item" %>
Expand Down
3 changes: 1 addition & 2 deletions app/views/current_playlist/songs/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<div
data-test-id='current_playlist'
data-controller='current-playlist-songs'
data-current-playlist-songs-should-play-value='<%= @should_play %>'>
<% if @songs.empty? %>
Expand All @@ -10,7 +9,7 @@
<span id='<%= dom_id(@playlist, :songs_count) %>'><%= @playlist.songs.count %></span>
<span><%= t("label.tracks") %></span>
</p>
<details class='c-dropdown' data-controller='dropdown' data-test-id='playlist_menu'>
<details class='c-dropdown' data-controller='dropdown'>
<summary class="c-button c-button--icon"><%= icon_tag "more-vertical", title: t("label.more") %></summary>
<div class='c-dropdown__menu' data-dropdown-target="menu">
<%= button_to t("button.clear"), current_playlist_songs_path, method: :delete, form_class: "c-dropdown__item" %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/dialog/albums/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% page_title_tag t("label.edit_album") %>
<%= form_with model: @album, data: {"turbo-frame" => "_top", "turbo-action" => ("replace" if native_app?), "test-id" => "album_edit_form"}, class: "c-form" do |form| %>
<%= form_with model: @album, data: {"turbo-frame" => "_top", "turbo-action" => ("replace" if native_app?)}, class: "c-form" do |form| %>
<div class='c-form__field'>
<%= form.label :cover_image, t("field.album_cover") %>
<%= form.file_field :cover_image, accept: "image/png, image/jpeg", class: "c-input" %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/dialog/artists/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% page_title_tag t("label.edit_artist") %>
<%= form_with model: @artist, data: {"turbo-frame" => "_top", "turbo-action" => ("replace" if native_app?), "test-id" => "artist_edit_form"}, class: "c-form" do |form| %>
<%= form_with model: @artist, data: {"turbo-frame" => "_top", "turbo-action" => ("replace" if native_app?)}, class: "c-form" do |form| %>
<div class='c-form__field'>
<%= form.label :cover_image, t("field.artist_cover") %>
<%= form.file_field :cover_image, accept: "image/png, image/jpeg", class: "c-input" %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/dialog/playlists/_playlist.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<button type="submit" class='c-list__item' formaction="<%= playlist_songs_path(playlist) %>" data-test-id="dialog_playlist">
<button type="submit" class='c-list__item' formaction="<%= playlist_songs_path(playlist) %>">
<%= playlist.name %>
</button>
3 changes: 1 addition & 2 deletions app/views/dialog/playlists/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
class: "c-form",
data: {
"turbo-frame" => "_top",
"turbo-action" => ("replace" if native_app?),
"test-id" => "playlist_edit_form"
"turbo-action" => ("replace" if native_app?)
}
) do |form| %>
<div class='c-form__field'>
Expand Down
4 changes: 2 additions & 2 deletions app/views/favorite_playlist/songs/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div class='o-container o-container--narrow' data-test-id='favorite_playlist'>
<div class='o-container o-container--narrow'>
<div data-controller='songs songs-bridge playlist-bridge' data-playlist-bridge-id-value='<%= @playlist.id %>'>
<div class="c-card c-card--horizontal u-my-large">
<div class='c-card__body'>
<h1 class='c-card__body__title' data-test-id='playlist_name'><%= @playlist.name %></h1>
<h1 class='c-card__body__title'><%= @playlist.name %></h1>
<div class='c-card__body__text'>
<span id='<%= dom_id(@playlist, :songs_count) %>'><%= @playlist.songs.size %></span>
<span><%= t("label.tracks") %></span>
Expand Down
2 changes: 0 additions & 2 deletions app/views/media_syncing/_button.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
t("button.syncing"),
false,
class: "c-button c-button--secondary",
data: {"test-id" => "media_sync_button"},
disabled: true
) %>
<% else %>
Expand All @@ -13,7 +12,6 @@
media_syncing_path,
class: "c-button c-button--secondary",
data: {
"test-id" => "media_sync_button",
"turbo-submits-with" => t("button.syncing")
}
) %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/playlists/_playlist.html.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<div class='o-grid__item c-card c-card--border' data-test-id='playlist'>
<div class='o-grid__item c-card c-card--border'>
<div class='c-card__body'>
<%= link_to playlist_songs_path(playlist), class: "o-flex o-flex--align-center" do %>
<% if playlist.favorite? %>
<%= icon_tag("heart", emphasis: true) %>
<% else %>
<%= icon_tag("queue-music") %>
<% end %>
<span class='u-text-truncate u-mr-narrow u-ml-tiny' data-test-id='playlist_name'><%= playlist.name %></span>
<span class='u-text-truncate u-mr-narrow u-ml-tiny'><%= playlist.name %></span>
<% end %>
</div>
</div>
8 changes: 4 additions & 4 deletions app/views/playlists/songs/_song.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<li id='<%= "#{dom_id(playlist)}_#{dom_id(song)}" %>' class='c-list__item u-p-0' data-songs-target='item' data-song-id='<%= song.id %>' data-test-id='playlist_song' draggable='true'>
<li id='<%= "#{dom_id(playlist)}_#{dom_id(song)}" %>' class='c-list__item u-p-0' data-songs-target='item' data-song-id='<%= song.id %>' draggable='true'>
<div class='o-flex o-flex--align-center u-py-narrow'>
<% unless mobile? %>
<button class='c-button c-button--icon js-playlist-sortable-item-handle u-mr-narrow' data-test-id='playlist_song_sortable_handle'><%= icon_tag "drag-indicator", size: "small" %></button>
<button class='c-button c-button--icon js-playlist-sortable-item-handle u-mr-narrow'><%= icon_tag "drag-indicator", size: "small" %></button>
<% end %>
<%= button_to(
Expand All @@ -19,7 +19,7 @@
) do %>
<div class='o-flex o-flex--justify-between o-flex--align-center'>
<div class='u-mr-narrow'>
<span class='u-mb-tiny u-text-line-clamp-2' data-test-id='playlist_song_name'><%= song.name %></span>
<span class='u-mb-tiny u-text-line-clamp-2'><%= song.name %></span>
<% if native_app? %>
<span class='c-list__item__subtext'><%= song.artist.name %></span>
<% else %>
Expand All @@ -29,7 +29,7 @@
<div class='u-text-monospace u-mr-narrow'><%= format_duration(song.duration) %></div>
</div>
<% end %>
<details class='c-dropdown' data-controller='dropdown' data-test-id='playlist_song_menu'>
<details class='c-dropdown' data-controller='dropdown'>
<summary class="c-button c-button--icon"><%= icon_tag "more-vertical", size: "small", title: t("label.more") %></summary>
<div class='c-dropdown__menu' data-dropdown-target="menu">
<%= button_to(
Expand Down
4 changes: 2 additions & 2 deletions app/views/playlists/songs/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div data-controller='songs songs-bridge playlist-bridge' data-playlist-bridge-id-value='<%= @playlist.id %>'>
<div class="c-card c-card--horizontal u-my-large">
<div class='c-card__body'>
<h1 class='c-card__body__title' data-test-id='playlist_name'><%= @playlist.name %></h1>
<h1 class='c-card__body__title'><%= @playlist.name %></h1>
<div class='c-card__body__text'>
<span id='<%= dom_id(@playlist, :songs_count) %>'><%= @playlist.songs.size %></span>
<span><%= t("label.tracks") %></span>
Expand All @@ -30,7 +30,7 @@
<% end %>
<%= link_to t("label.edit"), edit_dialog_playlist_path(@playlist), data: {"turbo-frame" => ("turbo-dialog" unless native_app?)}, class: "c-button c-button--secondary" %>

<details class='c-dropdown' data-controller='dropdown' data-test-id='playlist_menu'>
<details class='c-dropdown' data-controller='dropdown'>
<summary class="c-button c-button--secondary">
<%= icon_tag "more-horizontal", size: "narrow", title: t("label.more") %>
</summary>
Expand Down
2 changes: 1 addition & 1 deletion app/views/settings/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<%= form.text_field :discogs_token, value: Setting.discogs_token, class: "c-input" %>
</div>
<div class='c-form__field c-form__field--submit'>
<%= form.submit t("button.save"), class: "c-button c-button--primary c-button--full-width", data: {"test-id" => "setting_discogs_token_save_button"} %>
<%= form.submit t("button.save"), class: "c-button c-button--primary c-button--full-width" %>
</div>
<% end %>

Expand Down
14 changes: 7 additions & 7 deletions app/views/shared/_player.html.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<div class='c-player u-h-100' data-controller='player media-session'>
<div data-player-target='header' class='c-player__header u-position-relative' data-test-id='player_header'>
<div data-player-target='header' class='c-player__header u-position-relative'>
<div class='u-position-relative u-overflow-hidden'>
<div class='c-player__header__background' data-player-target='backgroundImage'></div>
<div class='c-player__header__content c-card c-card--horizontal u-p-medium u-position-relative'>
<img data-player-target='image' class='c-card__image u-image-small'>
<div class='c-card__body'>
<h1 class='c-card__body__title u-text-truncate' data-player-target='songName' data-test-id='player_song_name'></h1>
<h1 class='c-card__body__title u-text-truncate' data-player-target='songName'></h1>
<p class='c-card__body__text u-text-truncate' data-player-target='albumName'></p>
<p class='c-card__body__text u-text-truncate' data-player-target='artistName'></p>
<div class='c-card__body__text u-text-monospace u-mt-narrow'>
Expand All @@ -31,20 +31,20 @@
<%= icon_tag "shuffle", active: true, title: t("label.shuffle_mode"), data: {"player-target" => "modeButton"} %>
</button>
<div class="c-player__control__main o-flex o-flex--align-center">
<button class='c-button c-button--icon' data-action='click->player#previous' data-test-id='player_previous_button'>
<button class='c-button c-button--icon' data-action='click->player#previous'>
<%= icon_tag "rewind", size: "large", title: t("label.previous_song") %>
</button>
<button class='u-mx-medium c-button c-button--icon' data-action='click->player#play' data-player-target='playButton' data-test-id='player_play_button'>
<button class='u-mx-medium c-button c-button--icon' data-action='click->player#play' data-player-target='playButton'>
<%= icon_tag "play", size: "large", title: t("label.play_song") %>
</button>
<button class='u-mx-medium c-button c-button--icon u-display-none' data-action='click->player#pause' data-player-target='pauseButton' data-test-id='player_pause_button'>
<button class='u-mx-medium c-button c-button--icon u-display-none' data-action='click->player#pause' data-player-target='pauseButton'>
<%= icon_tag "pause", size: "large", title: t("label.pause_song") %>
</button>
<button class='c-button c-button--icon' data-action='click->player#next' data-test-id='player_next_button'>
<button class='c-button c-button--icon' data-action='click->player#next'>
<%= icon_tag "fast-forward", size: "large", title: t("label.next_song") %>
</button>
</div>
<div data-action='turbo:submit-end->player#toggleFavorite' data-test-id='player_favorite_button'>
<div data-action='turbo:submit-end->player#toggleFavorite'>
<%= button_to "#", class: "c-button c-button--icon", form_class: "u-visibility-hidden", form: {"data-player-target" => "favoriteButton"} do %>
<%= icon_tag "heart", title: t("label.toggle_favorite") %>
<% end %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/shared/_search_bar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
<%= icon_tag "search", size: "large" %>
</div>

<%= text_field_tag "query", query, class: "c-input", data: {"search-target" => "input", "test-id" => "search_input"}, autocomplete: "on" %>
<%= text_field_tag "query", query, class: "c-input", data: {"search-target" => "input"}, autocomplete: "on" %>

<div class='c-input-group__icon'>
<%= loader_tag size: "small" %>
</div>
<% end %>

<div class='o-flex o-flex--align-center o-flex__item o-flex__item--grow-1 o-flex__item--basic-0'>
<details class='c-dropdown u-ml-auto' data-controller='dropdown' data-test-id='search_bar_menu'>
<details class='c-dropdown u-ml-auto' data-controller='dropdown'>
<summary><%= avatar_tag current_user %></summary>
<div class='c-dropdown__menu' data-dropdown-target="menu">
<%= link_to t("label.settings"), setting_path, class: "c-dropdown__item" %>
Expand Down
5 changes: 2 additions & 3 deletions app/views/songs/_song.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<%= button_to(
current_playlist_songs_path(song_id: song.id, should_play: true),
class: "c-button c-button--link",
data: {"test-id" => "song_item"},
form: {
data: {
"delegated-action" => "turbo:submit-start-songs#checkBeforePlay click->songs-bridge#playNow",
Expand All @@ -12,7 +11,7 @@
}
}
) do %>
<span data-test-id='song_name'><%= song.name %></span>
<span><%= song.name %></span>
<% end %>
</div>
<div role='cell' class='u-display-none@medium'>
Expand All @@ -23,7 +22,7 @@
</div>
<div role='cell' class='u-display-none@small'><%= format_duration(song.duration) %></div>
<div role='cell'>
<details class='c-dropdown' data-controller='dropdown' data-test-id='song_menu'>
<details class='c-dropdown' data-controller='dropdown'>
<summary class="c-button c-button--icon">
<%= icon_tag "more-vertical", size: "small", title: t("label.more") %>
</summary>
Expand Down
2 changes: 1 addition & 1 deletion app/views/users/settings/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
<% end %>
</div>
<div class='c-form__field c-form__field--submit'>
<%= form.submit t("button.save"), class: "c-button c-button--primary c-button--full-width", data: {"test-id" => "setting_theme_save_button"} %>
<%= form.submit t("button.save"), class: "c-button c-button--primary c-button--full-width" %>
</div>
<% end %>
Loading

0 comments on commit 3c5c272

Please sign in to comment.