return function()local N=require(script.Parent.Parent.Parent.assertDeepEqual)local R=require(script.Parent.Parent.createElement)local z=require(script.Parent.Parent.createReconciler)local V=require(script.Parent.Parent.Parent.Option)local x=require(script.Parent.Parent.NoopRenderer)local b=require(script.Parent.Parent.Component)local q=z(x)it("\115\104\111\117\108\100 \102\105\108\108 \105\110 \119\104\101\110 \109\111\117\110\116\105\110\103 \098\101\102\111\114\101 \105\110\105\116",function()local z={a=3,b=2}local V=b:extend("\070\111\111")V.defaultProps=z local x function V.init(N)x=N.props end function V.render(N) end local K={b=4;c=6}local w=R(V,K)local U=nil local l="\083\111\109\101 \070\111\111"q.mountVirtualNode(w,U,l)local k={a=z.a,b=K.b,c=K.c}N(x,k)end)it("\115\104\111\117\108\100 \102\105\108\108 \105\110 \119\104\101\110 \117\112\100\097\116\105\110\103 \118\105\097 \112\114\111\112\115",function()local z={a=3,b=2}local V=b:extend("\070\111\111")V.defaultProps=z local x function V.render(N)x=N.props end local K={b=4;c=6}local w=R(V,K)local U=nil local l="\083\111\109\101 \070\111\111"local k=q.mountVirtualNode(w,U,l)local S={c=5}local B=R(V,S)q.updateVirtualNode(k,B)local y={a=z.a;b=z.b;c=S.c}N(x,y)end)it("\115\104\111\117\108\100 \114\101\115\112\101\099\116 \078\111\110\101 \116\111 \111\118\101\114\114\105\100\101 \097 \100\101\102\097\117\108\116 \112\114\111\112 \119\105\116\104 \110\105\108",function()local z={a=3;b=2}local x=b:extend("\070\111\111")x.defaultProps=z local K function x.render(N)K=N.props end local w={b=V.None;c=4}local U=R(x,w)local l=nil local k="\083\111\109\101 \070\111\111"q.mountVirtualNode(U,l,k)local S={a=z.a;b=nil;c=w.c}N(K,S)end)end
return function()
	local assertDeepEqual = require(script.Parent.Parent.Parent.assertDeepEqual)
	local createElement = require(script.Parent.Parent.createElement)
	local createReconciler = require(script.Parent.Parent.createReconciler)
	local Option = require(script.Parent.Parent.Parent.Option)
	local NoopRenderer = require(script.Parent.Parent.NoopRenderer)

	local Component = require(script.Parent.Parent.Component)

	local noopReconciler = createReconciler(NoopRenderer)

	it("should fill in when mounting before init", function()
		local defaultProps = {
			a = 3,
			b = 2,
		}

		local Foo = Component:extend("Foo")

		Foo.defaultProps = defaultProps

		local capturedProps
		function Foo:init()
			capturedProps = self.props
		end

		function Foo:render() end

		local initialProps = {
			b = 4,
			c = 6,
		}

		local element = createElement(Foo, initialProps)
		local hostParent = nil
		local key = "Some Foo"

		noopReconciler.mountVirtualNode(element, hostParent, key)

		local expectedProps = {
			a = defaultProps.a,
			b = initialProps.b,
			c = initialProps.c,
		}

		assertDeepEqual(capturedProps, expectedProps)
	end)

	it("should fill in when updating via props", function()
		local defaultProps = {
			a = 3,
			b = 2,
		}

		local Foo = Component:extend("Foo")

		Foo.defaultProps = defaultProps

		local capturedProps
		function Foo:render()
			capturedProps = self.props
		end

		local initialProps = {
			b = 4,
			c = 6,
		}

		local element = createElement(Foo, initialProps)
		local hostParent = nil
		local key = "Some Foo"

		local node = noopReconciler.mountVirtualNode(element, hostParent, key)

		local updatedProps = {
			c = 5,
		}
		local updatedElement = createElement(Foo, updatedProps)

		noopReconciler.updateVirtualNode(node, updatedElement)

		local expectedProps = {
			a = defaultProps.a,
			b = defaultProps.b,
			c = updatedProps.c,
		}

		assertDeepEqual(capturedProps, expectedProps)
	end)

	it("should respect None to override a default prop with nil", function()
		local defaultProps = {
			a = 3,
			b = 2,
		}

		local Foo = Component:extend("Foo")

		Foo.defaultProps = defaultProps

		local capturedProps
		function Foo:render()
			capturedProps = self.props
		end

		local initialProps = {
			b = Option.None,
			c = 4,
		}

		local element = createElement(Foo, initialProps)
		local hostParent = nil
		local key = "Some Foo"

		noopReconciler.mountVirtualNode(element, hostParent, key)

		local expectedProps = {
			a = defaultProps.a,
			b = nil,
			c = initialProps.c,
		}

		assertDeepEqual(capturedProps, expectedProps)
	end)
end
