local c=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 H=c.expect local e=c.describe local n=c.it local v=(require("\064\112\107\103\047\064\106\115\100\111\116\108\117\097\047\115\104\097\114\101\100")).isValidElementType local Q=(require("\064\112\107\103\047\064\106\115\100\111\116\108\117\097\047\115\104\097\114\101\100")).ReactSymbols local R e("\097\099\099\101\112\116 \101\108\101\109\101\110\116 \112\114\105\109\105\116\105\118\101\115",function()n("\102\114\111\109 \115\116\114\105\110\103\115",function()R="\084\101\120\116\076\097\098\101\108";(H(v(R))).toBe(true)end)n("\102\114\111\109 \102\117\110\099\116\105\111\110\115",function()R=function() end;(H(v(R))).toBe(true)end)n("\102\114\111\109 \116\097\098\108\101\115",function()R={}R["\036\036\116\121\112\101\111\102"]=Q.REACT_CONTEXT_TYPE;(H(v(R))).toBe(true)end)end)e("\100\111\101\115 \110\111\116 \097\099\099\101\112\116",function()n("\082\069\065\067\084\095\069\076\069\077\069\078\084\095\084\089\080\069",function()R={}R["\036\036\116\121\112\101\111\102"]=Q.REACT_ELEMENT_TYPE;(H(v(R))).toBe(false)end)end)
local JestGlobals = require("@pkg/@jsdotlua/jest-globals")
local jestExpect = JestGlobals.expect
local describe = JestGlobals.describe
local it = JestGlobals.it

local isValidElementType = require("@pkg/@jsdotlua/shared").isValidElementType
local ReactSymbols = require("@pkg/@jsdotlua/shared").ReactSymbols
local element

describe("accept element primitives", function()
	it("from strings", function()
		element = "TextLabel"
		jestExpect(isValidElementType(element)).toBe(true)
	end)

	it("from functions", function()
		element = function() end
		jestExpect(isValidElementType(element)).toBe(true)
	end)

	it("from tables", function()
		element = {}
		element["$$typeof"] = ReactSymbols.REACT_CONTEXT_TYPE
		jestExpect(isValidElementType(element)).toBe(true)
	end)
end)

describe("does not accept", function()
	it("REACT_ELEMENT_TYPE", function()
		element = {}
		element["$$typeof"] = ReactSymbols.REACT_ELEMENT_TYPE
		jestExpect(isValidElementType(element)).toBe(false)
	end)
end)
