local I=script.Parent.Parent local p=I.Parent local l=p.Parent local t=require(l.Dev.Roact)local o=require(l.Dev.ReactRoblox)local b=require(l.Dev.JestGlobals)local q=b.expect local Y=b.describe local S=b.it local X=require(l.LuauPolyfill)local W=X.Object local v=(require(I.utils))(t,o)Y("\117\116\105\108\115 \116\101\115\116\115",function()S("\115\104\111\117\108\100 \099\111\110\115\116\114\117\099\116 \097 \116\101\115\116 \098\108\111\099\107 \102\111\114 \114\111\097\099\116",function()local I={mockComponent="\109\111\099\107\067\111\109\112\111\110\101\110\116"}local p=Vector2.new(.5,.5)local l=v.createTestBlock(function(l)return{benchmarkType="\109\111\117\110\116";Component=I;getComponentProps=function()return{breadth=2;components=l;depth=7;id=0,wrap=1}end,Provider=l.Provider,sampleCount=50;anchorPoint=p}end);(q(#W.keys(l))).toBe(1)local t=l.roact;(q(t)).toBeDefined();(q(t.Component)).toBe(I);(q(t.Provider)).toBeDefined();(q(t.sampleCount)).toBe(50);(q(t.anchorPoint)).toBe(p);(q(t.benchmarkType)).toBe("\109\111\117\110\116");(q(t.version)).toBe("\063");(q(t.name)).toBe("\114\111\097\099\116")local o=t.getComponentProps();(q(o.breadth)).toBe(2);(q(o.components)).toBeDefined();(q(o.depth)).toBe(7);(q(o.id)).toBe(0);(q(o.wrap)).toBe(1)end)end)
local testWorkspace = script.Parent.Parent
local srcWorkspace = testWorkspace.Parent
local rootWorkspace = srcWorkspace.Parent

local Roact = require(rootWorkspace.Dev.Roact)
local ReactRoblox = require(rootWorkspace.Dev.ReactRoblox)
local JestGlobals = require(rootWorkspace.Dev.JestGlobals)
local jestExpect = JestGlobals.expect
local describe = JestGlobals.describe
local it = JestGlobals.it
local LuauPolyfill = require(rootWorkspace.LuauPolyfill)
local Object = LuauPolyfill.Object

local Utils = require(testWorkspace.utils)(Roact, ReactRoblox)

describe("utils tests", function()
	it("should construct a test block for roact", function()
		local mockComponent = { mockComponent = "mockComponent" }
		local anchorPoint = Vector2.new(0.5, 0.5)

		local testBlock = Utils.createTestBlock(function(components)
			return {
				benchmarkType = "mount",
				Component = mockComponent,
				getComponentProps = function()
					return { breadth = 2, components = components, depth = 7, id = 0, wrap = 1 }
				end,
				Provider = components.Provider,
				sampleCount = 50,
				anchorPoint = anchorPoint,
			}
		end)

		jestExpect(#Object.keys(testBlock)).toBe(1)

		local roact = testBlock.roact
		jestExpect(roact).toBeDefined()
		jestExpect(roact.Component).toBe(mockComponent)
		jestExpect(roact.Provider).toBeDefined()
		jestExpect(roact.sampleCount).toBe(50)
		jestExpect(roact.anchorPoint).toBe(anchorPoint)
		jestExpect(roact.benchmarkType).toBe("mount")
		jestExpect(roact.version).toBe("?")
		jestExpect(roact.name).toBe("roact")

		local props = roact.getComponentProps()
		jestExpect(props.breadth).toBe(2)
		jestExpect(props.components).toBeDefined()
		jestExpect(props.depth).toBe(7)
		jestExpect(props.id).toBe(0)
		jestExpect(props.wrap).toBe(1)
	end)
end)
