-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hot-fix: update form parent searching
- Loading branch information
Showing
6 changed files
with
94 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<script setup lang="ts"> | ||
import Form from "./../../../src/classes/Form"; | ||
import FormWithSubscribeParent from "./FormWithSubscribeParent.vue"; | ||
const form = new Form(); | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<form-with-subscribe-parent/> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<script setup lang="ts"> | ||
import Form from "./../../../src/classes/Form"; | ||
import FormWithoutSubscribeParent from "./FormWithoutSubscribeParent.vue"; | ||
const form = new Form(); | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<form-without-subscribe-parent/> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<script setup lang="ts"> | ||
import Form from "./../../../src/classes/Form"; | ||
const form = new Form({ | ||
name: "Test", | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div> | ||
|
||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
</style> |
18 changes: 18 additions & 0 deletions
18
tests/integrations/components/FormWithoutSubscribeParent.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<script setup lang="ts"> | ||
import Form from "./../../../src/classes/Form"; | ||
const form = new Form({ | ||
name: "Test", | ||
parent: false | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div> | ||
|
||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {mount} from "@vue/test-utils"; | ||
import Form from "./../../src/classes/Form"; | ||
import AppSubscribe from "./components/AppSubscribe.vue"; | ||
import AppWithoutSubscribe from "./components/AppWithoutSubscribe.vue"; | ||
|
||
describe("Parent Form", () => { | ||
|
||
test('with parent', () => { | ||
const app = mount(AppSubscribe) as any; | ||
const form = app.vm.form as Form; | ||
|
||
|
||
expect(form.dependencies.length).toBe(1) | ||
}) | ||
|
||
test('WithoutParent', () => { | ||
const app = mount(AppWithoutSubscribe) as any; | ||
const form = app.vm.form as Form; | ||
|
||
|
||
expect(form.dependencies.length).toBe(0) | ||
}) | ||
}) |