/**
 * Test script to validate themings are properly set for light/dark versions of theme
 */ import * as React from "react" ; import * as assert from "assert" ; import * as os from "os" ; import * as path from "path" ; import * as Oni from "oni-api" ; import { createNewFile } from "./Common" ; const getBackgroundColor = ( oni ) : string => { return oni . colors . getColor ( "editor.background" ) ; } ; export const test = async ( oni ) => { await oni . automation . waitForEditors ( ) ; const neovimAsAny = oni . editors . activeEditor . neovim ; oni . configuration . setValues ( { "ui.colorscheme" : "solarized8_light" } ) ; await oni . automation . waitFor ( ( ) => getBackgroundColor ( oni ) === "#eee8d5" ) ; let background = await neovimAsAny . request ( "nvim_get_option" , [ "background" ] ) ; assert . strictEqual ( background , "light" ) ; oni . configuration . setValues ( { "ui.colorscheme" : "solarized8_dark" } ) ; await oni . automation . waitFor ( ( ) => getBackgroundColor ( oni ) === "#073642" ) ; background = await neovimAsAny . request ( "nvim_get_option" , [ "background" ] ) ; assert . strictEqual ( background , "dark" ) ; oni . configuration . setValues ( { "ui.colorscheme" : "solarized8_light" } ) ; await oni . automation . waitFor ( ( ) => getBackgroundColor ( oni ) === "#eee8d5" ) ; background = await neovimAsAny . request ( "nvim_get_option" , [ "background" ] ) ; assert . strictEqual ( background , "light" ) ; assert . ok ( true , "Color switches were successful!" ) ; } ;