示例#1
0
文件: branch_test.go 项目: kego/ke
func TestBranchView_Unmount(t *testing.T) {
	cb := ctests.New(t).SetApp(true, true, false)
	defer cb.Finish()

	b := NewBranchView(cb.Ctx(), models.NewBranchModel(cb.Ctx(), &models.RootContents{Name: "a"}))

	c := mock_vecty.NewMockComponent(cb.GetMock())
	c.EXPECT().Unmount()
	b.Body = c
	b.Unmount()
	assert.Nil(t, b.Notifs)
}
示例#2
0
文件: ctests.go 项目: kego/ke
func (cb *ClientContextBuilder) ExpectReconcile(comp *vecty.Composite) *ClientContextBuilder {
	c := mock_vecty.NewMockComponent(cb.GetMock())
	c.EXPECT().Reconcile(nil)
	comp.RenderFunc = func() vecty.Component { return c }
	return cb
}