local e=require("\064\112\107\103\047\064\106\115\100\111\116\108\117\097\047\106\101\115\116-\103\108\111\098\097\108\115")local k=e.expect local p=e.it local f=require("\046\046\047\103\101\116\068\101\102\097\117\108\116\073\110\115\116\097\110\099\101\080\114\111\112\101\114\116\121")p("\115\104\111\117\108\100 \103\101\116 \100\101\102\097\117\108\116 \110\097\109\101 \115\116\114\105\110\103 \118\097\108\117\101\115",function()local e,p=f("\083\116\114\105\110\103\086\097\108\117\101","\078\097\109\101");(k(p)).toBe("\086\097\108\117\101")end)p("\115\104\111\117\108\100 \103\101\116 \100\101\102\097\117\108\116 \101\109\112\116\121 \115\116\114\105\110\103 \118\097\108\117\101\115",function()local e,p=f("\083\116\114\105\110\103\086\097\108\117\101","\086\097\108\117\101");(k(p)).toBe("")end)p("\115\104\111\117\108\100 \103\101\116 \100\101\102\097\117\108\116 \110\117\109\098\101\114 \118\097\108\117\101\115",function()local e,p=f("\073\110\116\086\097\108\117\101","\086\097\108\117\101");(k(p)).toBe(0)end)p("\115\104\111\117\108\100 \103\101\116 \110\105\108 \100\101\102\097\117\108\116 \118\097\108\117\101\115",function()local e,p=f("\079\098\106\101\099\116\086\097\108\117\101","\086\097\108\117\101");(k(p)).toBe(nil)end)p("\115\104\111\117\108\100 \103\101\116 \098\111\111\108 \100\101\102\097\117\108\116 \118\097\108\117\101\115",function()local e,p=f("\066\111\111\108\086\097\108\117\101","\086\097\108\117\101");(k(p)).toBe(false)end)
-- ROBLOX upstream: https://github.com/Roblox/roact/blob/b2ba9cf4c219c2654e6572219a68d0bf1b541418/src/getDefaultInstanceProperty.spec.lua
--[[
	* Copyright (c) Roblox Corporation. All rights reserved.
	* Licensed under the Apache License, Version 2.0 (the "License");
	* you may not use this file except in compliance with the License.
	* You may obtain a copy of the License at
	*
	*     http://www.apache.org/licenses/LICENSE-2.0
	*
	* Unless required by applicable law or agreed to in writing, software
	* distributed under the License is distributed on an "AS IS" BASIS,
	* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	* See the License for the specific language governing permissions and
	* limitations under the License.
]]

local JestGlobals = require("@pkg/@jsdotlua/jest-globals")
local jestExpect = JestGlobals.expect
local it = JestGlobals.it
local getDefaultInstanceProperty = require("../getDefaultInstanceProperty")

it("should get default name string values", function()
	local _, defaultName = getDefaultInstanceProperty("StringValue", "Name")

	jestExpect(defaultName).toBe("Value")
end)

it("should get default empty string values", function()
	local _, defaultValue = getDefaultInstanceProperty("StringValue", "Value")

	jestExpect(defaultValue).toBe("")
end)

it("should get default number values", function()
	local _, defaultValue = getDefaultInstanceProperty("IntValue", "Value")

	jestExpect(defaultValue).toBe(0)
end)

it("should get nil default values", function()
	local _, defaultValue = getDefaultInstanceProperty("ObjectValue", "Value")

	jestExpect(defaultValue).toBe(nil)
end)

it("should get bool default values", function()
	local _, defaultValue = getDefaultInstanceProperty("BoolValue", "Value")

	jestExpect(defaultValue).toBe(false)
end)
