Skip to content

Commit

Permalink
Fixes #1449 (#1497)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdriscoll authored Feb 3, 2020
1 parent 6bab6da commit 972ac92
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/UniversalDashboard.UITest/Integration/Toast.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ Describe "Toast" {
Start-Sleep 1
Hide-UDToast -Id "Hide"
}

New-UDButton -Text "Replace Toast" -Id "btnReplace" -OnClick {
Show-UDToast -Title "Shipped!" -Message "You order has shipped!" -Id "Replace" -Duration 5000 -Position "bottomLeft" -Icon user -ReplaceToast
}
}

$Server = Start-UDDashboard -Port 10001 -Dashboard $dashboard
Expand Down Expand Up @@ -48,6 +52,14 @@ Describe "Toast" {
$Text | Should be $null
}

It "should replace toast" {
Find-SeElement -Driver $Driver -Id 'btnReplace' | Invoke-SeClick

Start-Sleep -Seconds 3

(Find-SeElement -Driver $Driver -Id 'Replace' | Measure-Object).Count | should be 1
}

Stop-SeDriver $Driver
Stop-UDDashboard -Server $Server
}
Expand Down
2 changes: 1 addition & 1 deletion src/UniversalDashboard/Cmdlets/ShowToastCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ protected override void EndProcessing()
theme = Theme,
icon = Icon == FontAwesomeIcons.None ? "" : $"fa fa-{Icon.ToString().Replace("_", "-")}",
iconColor = IconColor?.HtmlColor,
replaceToast = ReplaceToast.IsPresent,
displayMode = ReplaceToast.IsPresent ? 2 : 0,
rtl = RightToLeft.IsPresent,
balloon = Balloon.IsPresent,
overlay = Overlay.IsPresent,
Expand Down

0 comments on commit 972ac92

Please sign in to comment.