Skip to content

Commit

Permalink
feat: additional testing -d
Browse files Browse the repository at this point in the history
  • Loading branch information
arpowers committed Sep 22, 2024
1 parent 531388e commit 8aeddd2
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions @fiction/core/test-utils/buildTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export async function performActions(args: {
const element = page.locator(action.selector || 'body')

if (action.wait) {
logger.info('WAIT_FOR', { data: { wait: `${action.wait}ms` } })
await waitFor(action.wait)
}

Expand Down
2 changes: 2 additions & 0 deletions @fiction/site/plugin-builder/SiteEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ async function resetToPublished() {
target="_blank"
size="md"
icon="i-tabler-arrow-up-right"
data-test-id="viewSiteButton"
>
View Site
</CardButton>
Expand All @@ -177,6 +178,7 @@ async function resetToPublished() {
:loading="sending === 'save'"
icon="i-tabler-arrow-big-up-lines"
size="md"
data-test-id="publishChangesButton"
@click.prevent="save()"
>
Publish Changes
Expand Down
1 change: 0 additions & 1 deletion @fiction/site/tables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ export const pageCols = [
new Col({ key: 'title', sec: 'setting', sch: () => z.string(), make: ({ s, col }) => s.string(col.k).defaultTo('') }),
new Col({ key: 'description', sec: 'setting', sch: () => z.string(), make: ({ s, col }) => s.text(col.k).defaultTo('') }),
new Col({ key: 'cards', sec: 'setting', sch: () => z.array(z.unknown()), make: ({ s, col }) => s.jsonb(col.k).defaultTo([]), prepare: ({ value }) => JSON.stringify(value) }),
new Col({ key: 'single', sec: 'setting', sch: () => z.array(z.unknown()), make: ({ s, col }) => s.jsonb(col.k).defaultTo({}), prepare: ({ value }) => JSON.stringify(value) }),
new Col({ key: 'effects', sec: 'setting', sch: () => z.array(z.unknown()), make: ({ s, col }) => s.jsonb(col.k).defaultTo([]), prepare: ({ value }) => JSON.stringify(value) }),
new Col({ key: 'userConfig', sec: 'setting', sch: () => z.record(z.unknown()), make: ({ s, col }) => s.jsonb(col.k).defaultTo({}), prepare: ({ value }) => JSON.stringify(value) }),
new Col({ key: 'isHome', sec: 'setting', sch: () => z.boolean(), make: ({ s, col }) => s.boolean(col.k).defaultTo(false) }),
Expand Down
12 changes: 9 additions & 3 deletions @fiction/site/test/admin.siteEditing.uiux.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,21 @@ describe('admin site editing', async () => {
{ type: 'hasText', selector: `[data-option-path="slides.0.title"]`, text: 'hello' },
{ type: 'hasText', selector: `[data-option-path="slides.0.subTitle"]`, text: 'world' },
] },
{ type: 'click', selector: `[data-test-id="publishChangesButton"]` },

{ type: 'frameInteraction', frameSelector: `#site-builder-iframe`, frameActions: [
{ type: 'fill', selector: `[data-option-path="slides.0.title"]`, text: 'change' },
{ type: 'fill', selector: `[data-option-path="slides.0.subTitle"]`, text: 'the text' },
] },

{ type: 'click', selector: `[data-test-id="draft-control-dropdown"] button` },
{ type: 'click', selector: `[data-test-id="draft-control-dropdown"] [data-test-id="reset-to-published"]` },
{ type: 'frameInteraction', frameSelector: `#site-builder-iframe`, frameActions: [
{ type: 'click', selector: `[data-test-id="nav-dot-0"]` },
{ type: 'hasText', selector: `[data-option-path="slides.0.title"]`, text: 'First and Last Name' },
{ type: 'hasText', selector: `[data-option-path="slides.0.subTitle"]`, text: 'Author and Speaker' },
{ type: 'hasText', selector: `[data-option-path="slides.0.title"]`, text: 'hello' },
{ type: 'hasText', selector: `[data-option-path="slides.0.subTitle"]`, text: 'world' },
] },
// { type: 'click', selector: `[data-test-id="tool-button-managePages"]` },
{ type: 'click', selector: `[data-test-id="tool-button-managePages"]` },
// { type: 'click', selector: `[data-test-id="addPage"]` },
// { type: 'fill', selector: `[data-option-path="title"] input`, texxt: `New Page ${slugId}` },
// { type: 'click', selector: `[data-test-id="requestCreateNewPage"]` },
Expand Down
1 change: 0 additions & 1 deletion @fiction/ui/effect/EffectFitText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ const initialFontSize = vue.computed(() => {
fontSize: initialFontSize,
maxWidth: '100%',
maxHeight: '100%',
overflow: 'hidden',
}"
>
<slot />
Expand Down

0 comments on commit 8aeddd2

Please sign in to comment.