Skip to content

Commit

Permalink
Fixes #865
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdriscoll committed Jun 13, 2019
1 parent f682ee0 commit 5a7bee4
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 9 deletions.
13 changes: 10 additions & 3 deletions src/UniversalDashboard.Materialize/Tests/driver.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,24 @@ function Get-TestData {

function Set-TestDashboard {
param(
[ScriptBlock]$Content
[Parameter(ParameterSetName = 'Content')]
[ScriptBlock]$Content,
[Parameter(ParameterSetName = 'Dashboard')]
[object]$Dashboard
)

$Global:StateCollection = New-Object -TypeName 'System.Collections.Concurrent.BlockingCollection[object]'

$Dashboard = New-UDDashboard -Content $Content -Title "TEST" -EndpointInitialization (New-UDEndpointInitialization -Variable "StateCollection" -Function "Set-TestData")
if ($Content) {
$Dashboard = New-UDDashboard -Content $Content -Title "TEST" -EndpointInitialization (New-UDEndpointInitialization -Variable "StateCollection" -Function "Set-TestData")
} else {
$Dashboard.EndpointInitialSessionState = (New-UDEndpointInitialization -Variable "StateCollection" -Function "Set-TestData")
}

$Server.DashboardService.SetDashboard($Dashboard)
Enter-SeUrl -Url "http://localhost:10001" -Driver $Driver
}


if ($OutputTestResultXml) {
$OutputPath = "$PSScriptRoot\test-results"
Remove-Item $OutputPath -Recurse -ErrorAction SilentlyContinue -Force
Expand Down
27 changes: 27 additions & 0 deletions src/UniversalDashboard.Materialize/Tests/navbar.tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Describe "Navbar" {
Context "colors" {
Set-TestDashboard -Dashboard (
New-UDDashboard -Title 'test' -NavBarColor 'black' -NavBarFontColor 'white' -Content {

}
)

It "should have the correct colors" {
Find-SeElement -Driver $Driver -ClassName 'ud-navbar' | Get-SeElementCssValue -Name 'background-color' | Should be 'rgb(0, 0, 0)'
Find-SeElement -Driver $Driver -ClassName 'ud-navbar' | Get-SeElementCssValue -Name 'color' | Should be 'rgb(255, 255, 255)'
}
}

Context "default colors" {
Set-TestDashboard -Dashboard (
New-UDDashboard -Title 'test' -Content {

}
)

It "should have the correct colors" {
Find-SeElement -Driver $Driver -ClassName 'ud-navbar' | Get-SeElementCssValue -Name 'background-color' | Should be 'rgb(36, 81, 131)'
Find-SeElement -Driver $Driver -ClassName 'ud-navbar' | Get-SeElementCssValue -Name 'color' | Should be 'rgb(255, 255, 255)'
}
}
}
12 changes: 6 additions & 6 deletions src/UniversalDashboard/Themes/Default.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
Name = "Default"
Definition = @{
UDDashboard = @{
BackgroundColor = "rgb(255,255,255) !important"
FontColor = "rgb(0, 0, 0) !important"
BackgroundColor = "rgb(255,255,255)"
FontColor = "rgb(0, 0, 0)"
}
UDNavBar = @{
BackgroundColor = "rgb(36, 81, 131) !important"
FontColor = "rgb(255, 255, 255) !important"
BackgroundColor = "rgb(36, 81, 131)"
FontColor = "rgb(255, 255, 255)"
}
UDFooter = @{
BackgroundColor = "rgb(36, 81, 131) !important"
FontColor = "rgb(255, 255, 255) !important"
BackgroundColor = "rgb(36, 81, 131)"
FontColor = "rgb(255, 255, 255)"
}
}
}

0 comments on commit 5a7bee4

Please sign in to comment.