local H=script.Parent.Parent.Parent local T=require(H.JestGlobals)local R=T.expect local a=T.test local U=T.beforeAll local h=T.afterAll local t=(require(H.DomTestingLibrary)).document local G=require(H.React)local n=(require(script.Parent.Parent)).render local F,e U(function()F=Instance.new("\070\114\097\109\101")e=Instance.new("\070\114\097\109\101")F.Parent=t e.Parent=t end)h(function()F.Parent=nil e.Parent=nil end)a("\098\097\115\101\069\108\101\109\101\110\116 \105\115\111\108\097\116\101\115 \116\114\101\101\115 \102\114\111\109 \111\110\101 \097\110\111\116\104\101\114",function()local H=(n(G.createElement("\084\101\120\116\076\097\098\101\108",{Text="\074\101\107\121\108\108"}),{baseElement=F})).getByText local T=(n(G.createElement("\084\101\120\116\076\097\098\101\108",{Text="\072\121\100\101"}),{baseElement=e})).getByText;(R(function()return H("\074\101\107\121\108\108")end)).never.toThrow("\085\110\097\098\108\101 \116\111 \102\105\110\100 \097\110 \101\108\101\109\101\110\116 \119\105\116\104 \116\104\101 \116\101\120\116\058 \074\101\107\121\108\108\046");(R(function()return T("\074\101\107\121\108\108")end)).toThrow("\085\110\097\098\108\101 \116\111 \102\105\110\100 \097\110 \101\108\101\109\101\110\116 \119\105\116\104 \116\104\101 \116\101\120\116\058 \074\101\107\121\108\108\046");(R(function()return H("\072\121\100\101")end)).toThrow("\085\110\097\098\108\101 \116\111 \102\105\110\100 \097\110 \101\108\101\109\101\110\116 \119\105\116\104 \116\104\101 \116\101\120\116\058 \072\121\100\101\046");(R(function()return T("\072\121\100\101")end)).never.toThrow("\085\110\097\098\108\101 \116\111 \102\105\110\100 \097\110 \101\108\101\109\101\110\116 \119\105\116\104 \116\104\101 \116\101\120\116\058 \072\121\100\101\046")end)return{}
-- ROBLOX upstream: https://github.com/testing-library/react-testing-library/blob/v12.1.5/src/__tests__/multi-base.js
local Packages = script.Parent.Parent.Parent

local JestGlobals = require(Packages.JestGlobals)
local expect = JestGlobals.expect
local test = JestGlobals.test
local beforeAll = JestGlobals.beforeAll

local afterAll = JestGlobals.afterAll

local document = require(Packages.DomTestingLibrary).document

local React = require(Packages.React)
local render = require(script.Parent.Parent).render

-- these are created once per test suite and reused for each case
local treeA, treeB
beforeAll(function()
	treeA = Instance.new("Frame")
	treeB = Instance.new("Frame")
	treeA.Parent = document
	treeB.Parent = document
end)

afterAll(function()
	treeA.Parent = nil
	treeB.Parent = nil
end)

test("baseElement isolates trees from one another", function()
	local getByTextInA =
		render(React.createElement("TextLabel", { Text = "Jekyll" }), { baseElement = treeA }).getByText
	local getByTextInB = render(React.createElement("TextLabel", { Text = "Hyde" }), { baseElement = treeB }).getByText

	expect(function()
		return getByTextInA("Jekyll")
	end).never.toThrow("Unable to find an element with the text: Jekyll.")

	expect(function()
		return getByTextInB("Jekyll")
	end).toThrow("Unable to find an element with the text: Jekyll.")

	expect(function()
		return getByTextInA("Hyde")
	end).toThrow("Unable to find an element with the text: Hyde.")

	expect(function()
		return getByTextInB("Hyde")
	end).never.toThrow("Unable to find an element with the text: Hyde.")
end)
-- https://github.com/testing-library/eslint-plugin-testing-library/issues/188
--[[
		eslint
  		testing-library/prefer-screen-queries: "off",
	]]
return {}
