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.Scheduler)local q=require(l.Dev.JestGlobals)local Y=q.expect local S=q.describe local X=q.it local W=q.beforeEach local v=q.afterEach local w=require(l.LuauPolyfill)local P=w.Array local A=((require(I.concurrent))(t,b)).Concurrent local N=(require(p.testUtils.bootstrapSync))(t,o)S("\067\111\110\099\117\114\114\101\110\116 \101\120\097\109\112\108\101 \116\101\115\116\115",function()local I local p W(function()I=Instance.new("\070\111\108\100\101\114")I.Name="\071\117\105\082\111\111\116"p=N(I,A)end)v(function()p()end)X("\115\104\111\117\108\100 \114\101\110\100\101\114 \066\108\111\099\107\115",function()local p=I:GetDescendants()local l=#P.filter(p,function(I)return I.Name=="\066\108\111\099\107"end);(Y(l)).toBe(600)end)X("\115\104\111\117\108\100 \114\101\110\100\101\114 \066\111\120\101\115",function()local p=I:GetDescendants()local l=#P.filter(p,function(I)return I.Name=="\066\111\120"end);(Y(l)).toBe(1000)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 Scheduler = require(rootWorkspace.Dev.Scheduler)

local JestGlobals = require(rootWorkspace.Dev.JestGlobals)
local jestExpect = JestGlobals.expect
local describe = JestGlobals.describe
local it = JestGlobals.it
local beforeEach = JestGlobals.beforeEach
local afterEach = JestGlobals.afterEach

local LuauPolyfill = require(rootWorkspace.LuauPolyfill)
local Array = LuauPolyfill.Array

local Concurrent = require(testWorkspace.concurrent)(Roact, Scheduler).Concurrent
local bootstrapSync = require(srcWorkspace.testUtils.bootstrapSync)(Roact, ReactRoblox)

describe("Concurrent example tests", function()
	local rootInstance
	local stop

	beforeEach(function()
		rootInstance = Instance.new("Folder")
		rootInstance.Name = "GuiRoot"

		stop = bootstrapSync(rootInstance, Concurrent)
	end)

	afterEach(function()
		stop()
	end)

	it("should render Blocks", function()
		local descendants = rootInstance:GetDescendants()
		local count = #Array.filter(descendants, function(item)
			return item.Name == "Block"
		end)

		jestExpect(count).toBe(600)
	end)

	it("should render Boxes", function()
		local descendants = rootInstance:GetDescendants()
		local count = #Array.filter(descendants, function(item)
			return item.Name == "Box"
		end)

		jestExpect(count).toBe(1000)
	end)
end)
