Skip to content

Commit

Permalink
verify change on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sadiqkhoja committed Apr 23, 2024
1 parent 205858b commit 7a73881
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
7 changes: 5 additions & 2 deletions packages/ui-vue/e2e/vue.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ test('All forms are rendered and there is no console error', async ({ page, brow
let consoleErrors = 0;

page.on('console', msg => {
if(msg.type() === 'error') {
if(msg.type() === 'error' || msg.type() === 'warning') {
consoleErrors++;
}
});

await page.goto('/');

await expect(page.getByText('Demo Forms')).toBeVisible();

const forms = await page.getByText('Show').all();

expect(forms.length).toBeGreaterThan(0);

for (const form of forms) {
await form.click();

Expand Down Expand Up @@ -51,7 +55,6 @@ test('All forms are rendered and there is no console error', async ({ page, brow
await page.getByText('Back').click();
}

// Assert that there's no console errors
expect(consoleErrors).toBe(0);

});
21 changes: 12 additions & 9 deletions packages/ui-vue/src/OdkWebFormDemo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,18 @@ const handleSubmit = (data: string) => {
</script>

<template>
<ul v-if="!selectForm">
<li v-for="form in demoForms" :key="form[0]">
{{ form[0] }}
<button @click="selectForm = form">
Show
</button>
</li>
</ul>
<template>
<div v-if="!selectForm">
<h1>Demo Forms</h1>
<ul>
<li v-for="form in demoForms" :key="form[0]">
{{ form[0] }}
<button @click="selectForm = form">
Show
</button>
</li>
</ul>
</div>
<div v-else>
<button @click="selectForm = null">
Back
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-vue/src/components/FormQuestion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const isStringNode = (n: AnyLeafNode) : n is StringNode => n.nodeType === 'strin

<template>
<div class="flex flex-column gap-2">
<InputText v-if="isStringNode(question)" :question="question" />
<InputText v-if="true || isStringNode(question)" :question="question" />

<UnsupportedControl v-else :question="question" />
</div>
Expand Down

0 comments on commit 7a73881

Please sign in to comment.