e0a5f57793
Vendor the rebranded BoosAPI Desktop client (Tauri + Vue) into metapi as a monorepo subdirectory under desktop/. Source only — node_modules, dist, Cargo target and the upstream .git history are excluded. desktop/ keeps its own independent Cargo workspace (desktop/src-tauri with crates/*); it is not part of the backend boosapi crate, so a `cargo check` at the metapi root still compiles only the backend. Build the desktop app from desktop/src-tauri per desktop/README.md. Note: app icons are still placeholder assets pending the final BoosAPI logo. The updater signing keys live outside the repo and are not included.
113 lines
2.8 KiB
TypeScript
113 lines
2.8 KiB
TypeScript
import { mount } from '@vue/test-utils'
|
|
import { describe, expect, it } from 'vitest'
|
|
import NodeRenderer from '../src/components/NodeRenderer'
|
|
import { flushAll } from './setup/flush-all'
|
|
|
|
describe('link loading state', () => {
|
|
it('renders a subtle loading hint instead of an interactive anchor', async () => {
|
|
const wrapper = mount(NodeRenderer, {
|
|
props: {
|
|
typewriter: false,
|
|
batchRendering: false,
|
|
nodes: [
|
|
{
|
|
type: 'paragraph',
|
|
raw: '',
|
|
children: [
|
|
{
|
|
type: 'link',
|
|
href: 'https://example.com',
|
|
title: null,
|
|
text: 'Example',
|
|
raw: '[Example](https://example.com',
|
|
loading: true,
|
|
children: [
|
|
{
|
|
type: 'text',
|
|
content: 'Example',
|
|
raw: 'Example',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
})
|
|
|
|
await flushAll()
|
|
|
|
expect(wrapper.find('a.link-node').exists()).toBe(false)
|
|
|
|
const loading = wrapper.get('.link-loading')
|
|
expect(loading.text()).toContain('Example')
|
|
expect(loading.find('.link-loading-indicator').exists()).toBe(true)
|
|
})
|
|
|
|
it('replays appended-text fade while a loading link label grows', async () => {
|
|
const wrapper = mount(NodeRenderer, {
|
|
props: {
|
|
batchRendering: false,
|
|
nodes: [
|
|
{
|
|
type: 'paragraph',
|
|
raw: '',
|
|
children: [
|
|
{
|
|
type: 'link',
|
|
href: 'https://example.com',
|
|
title: null,
|
|
text: 'Exam',
|
|
raw: '[Exam](https://example.com',
|
|
loading: true,
|
|
children: [
|
|
{
|
|
type: 'text',
|
|
content: 'Exam',
|
|
raw: 'Exam',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
})
|
|
|
|
await flushAll()
|
|
|
|
await wrapper.setProps({
|
|
nodes: [
|
|
{
|
|
type: 'paragraph',
|
|
raw: '',
|
|
children: [
|
|
{
|
|
type: 'link',
|
|
href: 'https://example.com',
|
|
title: null,
|
|
text: 'Example',
|
|
raw: '[Example](https://example.com',
|
|
loading: true,
|
|
children: [
|
|
{
|
|
type: 'text',
|
|
content: 'Example',
|
|
raw: 'Example',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
})
|
|
await flushAll()
|
|
|
|
const loading = wrapper.get('.link-loading')
|
|
const delta = loading.get('.text-node-stream-delta')
|
|
|
|
expect(delta.text()).toBe('ple')
|
|
expect(loading.text()).toContain('Example')
|
|
})
|
|
})
|