Skip to content

Commit 4fd8446

Browse files
Merge pull request #514 from NeoCoderMatrix86/508-recorded-tracks-are-not-linked-to-each-other
Recorded tracks are not linked to each other
2 parents 20b8794 + cd10e30 commit 4fd8446

14 files changed

Lines changed: 103 additions & 30 deletions

File tree

.github/workflows/build_pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
dotnet-version: 9.0.x
2525

2626
- name: Install wasm-tools
27-
run: dotnet workload install wasm-tools
27+
run: dotnet workload install wasm-tools-net9
2828

2929
- name: Build release
3030
run: dotnet publish AudioCuesheetEditor --configuration Release --output release

.github/workflows/run_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
dotnet-version: 9.0.x
2222

2323
- name: Install wasm-tools
24-
run: dotnet workload install wasm-tools
24+
run: dotnet workload install wasm-tools-net9
2525

2626
- name: Build & Install
2727
run: dotnet build

AudioCuesheetEditor.End2EndTests/Models/DetailView.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ internal async Task SelectTracksAsync(IEnumerable<int> trackTablePositions, Bool
8585
}
8686
}
8787

88+
internal async Task EditSelectedTracksModalAsync()
89+
{
90+
await _page.GetByRole(AriaRole.Button, new() { Name = "Edit selected tracks" }).ClickAsync();
91+
}
92+
8893
internal async Task EditTracksModalAsync(string artist, string title, string end, IEnumerable<string> flagsToSelect)
8994
{
9095
await _page.GetByRole(AriaRole.Button, new() { Name = "Edit selected tracks" }).ClickAsync();
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//This file is part of AudioCuesheetEditor.
2+
3+
//AudioCuesheetEditor is free software: you can redistribute it and/or modify
4+
//it under the terms of the GNU General Public License as published by
5+
//the Free Software Foundation, either version 3 of the License, or
6+
//(at your option) any later version.
7+
8+
//AudioCuesheetEditor is distributed in the hope that it will be useful,
9+
//but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
//GNU General Public License for more details.
12+
13+
//You should have received a copy of the GNU General Public License
14+
//along with Foobar. If not, see
15+
//<http: //www.gnu.org/licenses />.
16+
using Microsoft.Playwright;
17+
using System.Text.RegularExpressions;
18+
19+
namespace AudioCuesheetEditor.End2EndTests.Models
20+
{
21+
internal partial class ViewModes(IPage page, bool mobile)
22+
{
23+
private readonly IPage _page = page;
24+
private readonly bool _isMobile = mobile;
25+
26+
internal async Task SwitchView(string viewMode)
27+
{
28+
if (_isMobile)
29+
{
30+
await _page.GetByRole(AriaRole.Button).Filter(new() { HasTextRegex = ViewModeForward() }).Nth(4).ClickAsync();
31+
}
32+
await _page.GetByText(viewMode).ClickAsync();
33+
}
34+
35+
[GeneratedRegex("^$")]
36+
internal static partial Regex ViewModeForward();
37+
}
38+
}

AudioCuesheetEditor.End2EndTests/Tests/Desktop/RecordTest.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ public class RecordTest : PlaywrightTestBase
2525
public async Task Record_ShouldRecordTracks_WhenTracksAdded()
2626
{
2727
var recordView = new RecordView(TestPage);
28+
var viewModes = new ViewModes(TestPage, DeviceName != null);
29+
var detailView = new DetailView(TestPage, DeviceName != null);
2830
await recordView.GotoAsync();
2931
await recordView.StartRecordingAsync();
3032
await recordView.AddRecordingTrackAsync("Test Track 1 Artist", "Test Track 1 Title");
@@ -34,6 +36,10 @@ public async Task Record_ShouldRecordTracks_WhenTracksAdded()
3436
await Expect(TestPage.GetByRole(AriaRole.Cell, new() { Name = "Test Track 1 Title Clear" })).ToBeVisibleAsync();
3537
await Expect(TestPage.GetByRole(AriaRole.Cell, new() { Name = "Test Track 2 Artist Clear" })).ToBeVisibleAsync();
3638
await Expect(TestPage.GetByRole(AriaRole.Cell, new() { Name = "Test Track 2 Title Clear" })).ToBeVisibleAsync();
39+
await viewModes.SwitchView("Detail view");
40+
await detailView.SelectTracksAsync([1]);
41+
await detailView.EditSelectedTracksModalAsync();
42+
await Expect(TestPage.GetByRole(AriaRole.Checkbox, new() { Name = "Link to previous track" })).ToBeCheckedAsync();
3743
}
3844
}
3945
}

AudioCuesheetEditor.End2EndTests/Tests/Smartphone/RecordTestSmartphone.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ public class RecordTestSmartphone : PlaywrightTestBase
2626
public async Task Record_ShouldRecordTracks_WhenTracksAdded()
2727
{
2828
var recordView = new RecordView(TestPage);
29+
var viewModes = new ViewModes(TestPage, DeviceName != null);
30+
var detailView = new DetailView(TestPage, DeviceName != null);
2931
await recordView.GotoAsync();
3032
await recordView.StartRecordingAsync();
3133
await recordView.AddRecordingTrackAsync("Test Track 1 Artist", "Test Track 1 Title");
@@ -35,6 +37,10 @@ public async Task Record_ShouldRecordTracks_WhenTracksAdded()
3537
await Expect(TestPage.GetByRole(AriaRole.Cell, new() { Name = "Test Track 1 Title Clear" })).ToBeVisibleAsync();
3638
await Expect(TestPage.GetByRole(AriaRole.Cell, new() { Name = "Test Track 2 Artist Clear" })).ToBeVisibleAsync();
3739
await Expect(TestPage.GetByRole(AriaRole.Cell, new() { Name = "Test Track 2 Title Clear" })).ToBeVisibleAsync();
40+
await viewModes.SwitchView("Detail view");
41+
await detailView.SelectTracksAsync([1]);
42+
await detailView.EditSelectedTracksModalAsync();
43+
await Expect(TestPage.GetByRole(AriaRole.Checkbox, new() { Name = "Link to previous track" })).ToBeCheckedAsync();
3844
}
3945
}
4046
}

AudioCuesheetEditor/Pages/Index.razor

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ along with Foobar. If not, see
2121
@inherits BaseLocalizedComponent
2222

2323
@inject IStringLocalizer<Index> _localizer
24-
@inject ILocalStorageOptionsProvider _localStorageOptionsProvider
2524

2625
<CascadingValue Value="currentViewmode">
2726
<MudTabs Rounded ApplyEffectsToContainer Outlined Color="Color.Success" ActivePanelIndex="(int)currentViewmode" ActivePanelIndexChanged="this.AsNonRenderingEventHandler<int>(ActiveTabIndexChanged)">
@@ -44,17 +43,17 @@ along with Foobar. If not, see
4443
protected override async Task OnInitializedAsync()
4544
{
4645
await base.OnInitializedAsync();
47-
options = await _localStorageOptionsProvider.GetOptionsAsync<ViewOptions>();
46+
options = await base.LocalStorageOptionsProvider.GetOptionsAsync<ViewOptions>();
4847
currentViewmode = options.ActiveTab;
49-
_localStorageOptionsProvider.OptionSaved += LocalStorageOptionsProvider_OptionSaved;
48+
base.LocalStorageOptionsProvider.OptionSaved += LocalStorageOptionsProvider_OptionSaved;
5049
}
5150

5251
protected override void Dispose(bool disposing)
5352
{
5453
base.Dispose(disposing);
5554
if (disposing)
5655
{
57-
_localStorageOptionsProvider.OptionSaved -= LocalStorageOptionsProvider_OptionSaved;
56+
base.LocalStorageOptionsProvider.OptionSaved -= LocalStorageOptionsProvider_OptionSaved;
5857
}
5958
}
6059

AudioCuesheetEditor/Shared/Dialogs/DownloadProjectfileDialog.razor

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ along with Foobar. If not, see
2121
@inject ISessionStateContainer _sessionStateContainer
2222
@inject IBlazorDownloadFileService _blazorDownloadFileService
2323
@inject ValidationService _validationService
24-
@inject ILocalStorageOptionsProvider _localStorageOptionsProvider
2524

2625
<MudDialog>
2726
<DialogContent>
@@ -42,14 +41,14 @@ along with Foobar. If not, see
4241
protected override async Task OnInitializedAsync()
4342
{
4443
await base.OnInitializedAsync();
45-
options = await _localStorageOptionsProvider.GetOptionsAsync<DownloadOptions>();
46-
_localStorageOptionsProvider.OptionSaved += LocalStorageOptionsProvider_OptionSaved;
44+
options = await base.LocalStorageOptionsProvider.GetOptionsAsync<DownloadOptions>();
45+
base.LocalStorageOptionsProvider.OptionSaved += LocalStorageOptionsProvider_OptionSaved;
4746
}
4847

4948
protected override void Dispose(bool disposing)
5049
{
5150
base.Dispose(disposing);
52-
_localStorageOptionsProvider.OptionSaved -= LocalStorageOptionsProvider_OptionSaved;
51+
base.LocalStorageOptionsProvider.OptionSaved -= LocalStorageOptionsProvider_OptionSaved;
5352
}
5453

5554
async Task DownloadProjectClick()

AudioCuesheetEditor/Shared/Dialogs/GenerateCuesheetDialog.razor

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ along with Foobar. If not, see
2222
@inject ValidationService _validationService
2323
@inject IBlazorDownloadFileService _blazorDownloadFileService
2424
@inject CuesheetExportService _cuesheetExportService
25-
@inject ILocalStorageOptionsProvider _localStorageOptionsProvider
2625

2726
<MudDialog>
2827
<DialogContent>
@@ -64,15 +63,15 @@ along with Foobar. If not, see
6463
protected override async Task OnInitializedAsync()
6564
{
6665
await base.OnInitializedAsync();
67-
options = await _localStorageOptionsProvider.GetOptionsAsync<DownloadOptions>();
68-
_localStorageOptionsProvider.OptionSaved += LocalStorageOptionsProvider_OptionSaved;
66+
options = await base.LocalStorageOptionsProvider.GetOptionsAsync<DownloadOptions>();
67+
base.LocalStorageOptionsProvider.OptionSaved += LocalStorageOptionsProvider_OptionSaved;
6968
exportfiles = _cuesheetExportService.GenerateExportfiles(options?.CuesheetFilename);
7069
}
7170

7271
protected override void Dispose(bool disposing)
7372
{
7473
base.Dispose(disposing);
75-
_localStorageOptionsProvider.OptionSaved -= LocalStorageOptionsProvider_OptionSaved;
74+
base.LocalStorageOptionsProvider.OptionSaved -= LocalStorageOptionsProvider_OptionSaved;
7675
}
7776

7877
String? GetValidationErrorMessage()

AudioCuesheetEditor/Shared/Dialogs/SettingsDialog.razor

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ along with Foobar. If not, see
1919

2020
@inject IStringLocalizer<SettingsDialog> _localizer
2121
@inject ValidationService _validationService
22-
@inject ILocalStorageOptionsProvider _localStorageOptionsProvider
2322

2423
<MudDialog>
2524
<DialogContent>

0 commit comments

Comments
 (0)