local C=script.Parent.Parent local c=C.Parent.Parent local n=c.Parent local S=require(n.Dev.Roact)local U=require(n.Dev.ReactRoblox)local O=require(n.Dev.JestGlobals)local w=O.expect local p=O.describe local l=O.it local R=O.afterEach local N=((require(C.SierpinskiTriangle))(S,U)).SierpinskiTriangle local L=(require(c.testUtils.bootstrapSync))(S,U)local m=(require(c.benchmarks.implementations.roact))(S,U)p("\115\105\101\114\112\105\110\115\107\105 \116\114\105\097\110\103\108\101 \098\101\110\099\104\109\097\114\107 \099\097\115\101 \116\101\115\116\115 \040\114\111\097\099\116\041",function()local C R(function()if C then C()C=nil end end)l("\115\104\111\117\108\100 \114\101\110\100\101\114 \119\105\116\104 \099\104\105\108\100\114\101\110 \109\097\116\099\104\105\110\103 \099\111\110\102\105\103\117\114\101\100 \099\111\117\110\116",function()local c={components=m;s=200,sampleCount=50;x=0,y=0}local n=Instance.new("\070\111\108\100\101\114")n.Name="\071\117\105\082\111\111\116"C=L(n,N,c)local S=n:GetChildren()local U=#S;(w(U)).toBe(243)end)end)
local testWorkspace = script.Parent.Parent
local srcWorkspace = testWorkspace.Parent.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 afterEach = JestGlobals.afterEach

local SierpinskiTriangle = require(testWorkspace.SierpinskiTriangle)(Roact, ReactRoblox).SierpinskiTriangle
local bootstrapSync = require(srcWorkspace.testUtils.bootstrapSync)(Roact, ReactRoblox)
local components = require(srcWorkspace.benchmarks.implementations.roact)(Roact, ReactRoblox)

describe("sierpinski triangle benchmark case tests (roact)", function()
	local stop

	afterEach(function()
		if stop then
			stop()
			stop = nil
		end
	end)

	it("should render with children matching configured count", function()
		local props = {
			components = components,
			s = 200,
			sampleCount = 50,
			x = 0,
			y = 0,
		}

		local rootInstance = Instance.new("Folder")
		rootInstance.Name = "GuiRoot"
		stop = bootstrapSync(rootInstance, SierpinskiTriangle, props)

		local children = rootInstance:GetChildren()
		local count = #children

		jestExpect(count).toBe(243)
	end)
end)
