feat: restore legacy drag events and Tornado launch integration
This commit is contained in:
@@ -61,6 +61,31 @@ public sealed class LegacyBridgeProtocolTests
|
||||
out _));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParsePlaylistReorder_UsesOnlyOpaqueRowsAndClosedDropPosition()
|
||||
{
|
||||
Assert.True(LegacyBridgeProtocol.TryParseIntent(
|
||||
"{\"type\":\"reorder-playlist-rows\",\"payload\":{\"sourceRowId\":\"legacy-stock-00000001\",\"targetRowId\":\"legacy-stock-00000004\",\"position\":\"before\"}}",
|
||||
out var parsed,
|
||||
out _));
|
||||
|
||||
var reorder = Assert.IsType<LegacyReorderPlaylistRowsIntent>(parsed);
|
||||
Assert.Equal("legacy-stock-00000001", reorder.SourceRowId);
|
||||
Assert.Equal("legacy-stock-00000004", reorder.TargetRowId);
|
||||
Assert.Equal(LegacyDragDropPosition.Before, reorder.Position);
|
||||
|
||||
foreach (var invalid in new[]
|
||||
{
|
||||
"{\"type\":\"reorder-playlist-rows\",\"payload\":{\"sourceRowId\":\"../row\",\"targetRowId\":\"legacy-stock-00000004\",\"position\":\"before\"}}",
|
||||
"{\"type\":\"reorder-playlist-rows\",\"payload\":{\"sourceRowId\":\"legacy-stock-00000001\",\"targetRowId\":\"legacy-stock-00000001\",\"position\":\"before\"}}",
|
||||
"{\"type\":\"reorder-playlist-rows\",\"payload\":{\"sourceRowId\":\"legacy-stock-00000001\",\"targetRowId\":\"legacy-stock-00000004\",\"position\":\"middle\"}}",
|
||||
"{\"type\":\"reorder-playlist-rows\",\"payload\":{\"sourceRowId\":\"legacy-stock-00000001\",\"targetRowId\":\"legacy-stock-00000004\",\"position\":\"before\",\"targetIndex\":3}}"
|
||||
})
|
||||
{
|
||||
Assert.False(LegacyBridgeProtocol.TryParseIntent(invalid, out _, out _));
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ParseAllPlaylistEnabled_RequiresOnlyBooleanState()
|
||||
{
|
||||
@@ -96,6 +121,19 @@ public sealed class LegacyBridgeProtocolTests
|
||||
Assert.Equal(LegacyOperatorTabId.Theme, parsedSwap.Source);
|
||||
Assert.Equal(LegacyOperatorTabId.Exchange, parsedSwap.Target);
|
||||
|
||||
Assert.True(LegacyBridgeProtocol.TryParseIntent(
|
||||
"{\"type\":\"hover-swap-tabs\",\"payload\":{\"source\":\"theme\",\"target\":\"exchange\",\"expectedSourceIndex\":6,\"expectedTargetIndex\":1}}",
|
||||
out var hoverSwap,
|
||||
out _));
|
||||
var parsedHover = Assert.IsType<LegacyHoverSwapTabsIntent>(hoverSwap);
|
||||
Assert.Equal(6, parsedHover.ExpectedSourceIndex);
|
||||
Assert.Equal(1, parsedHover.ExpectedTargetIndex);
|
||||
|
||||
Assert.False(LegacyBridgeProtocol.TryParseIntent(
|
||||
"{\"type\":\"hover-swap-tabs\",\"payload\":{\"source\":\"theme\",\"target\":\"exchange\",\"expectedSourceIndex\":6,\"expectedTargetIndex\":10}}",
|
||||
out _,
|
||||
out _));
|
||||
|
||||
Assert.False(LegacyBridgeProtocol.TryParseIntent(
|
||||
"{\"type\":\"select-tab\",\"payload\":{\"tabId\":\"scene5001\"}}",
|
||||
out _,
|
||||
|
||||
Reference in New Issue
Block a user