Skip to main content
Version: v1 (Current)

Phase 7: Testing & Polish

Historical design/implementation plan. It is retained as background, not a statement that every proposed feature is available. Use the current component/project guides and the deployed editor before following its recipes.

Estimated Effort: 3-4 hours Dependencies: Phase 6 complete Jira: EZ-2206

Overview​

Comprehensive testing, bug fixes, polish, and final quality assurance. This phase ensures the app store modal is production-ready with good error handling, accessibility, and user experience.

Objectives​

  • Write comprehensive component tests
  • Add accessibility improvements
  • Polish UI/UX details
  • Fix any discovered bugs
  • Performance optimization
  • Documentation updates
  • Final QA testing

Implementation Steps​

Step 1: Component Tests​

Create test files:

mkdir -p resources/js/Components/Mod/AppStoreModal/__tests__

File: resources/js/Components/Mod/AppStoreModal/__tests__/AppStoreCard.test.js

import { describe, it, expect, vi } from 'vitest'
import { mount } from '@vue/test-utils'
import AppStoreCard from '../AppStoreCard.vue'

describe('AppStoreCard', () => {
const mockApp = {
id: 1,
name: 'Test App',
short_description: 'A test application',
icon: 'users',
background_color: '#3490dc',
tags: ['productivity', 'forms']
}

it('renders app information correctly', () => {
const wrapper = mount(AppStoreCard, {
props: { app: mockApp }
})

expect(wrapper.text()).toContain('Test App')
expect(wrapper.text()).toContain('A test application')
})

it('shows overlay on hover', async () => {
const wrapper = mount(AppStoreCard, {
props: { app: mockApp }
})

await wrapper.trigger('mouseenter')
expect(wrapper.find('.card-overlay').exists()).toBe(true)

await wrapper.trigger('mouseleave')
// Overlay should still exist but be transitioning out
expect(wrapper.find('.card-overlay').exists()).toBe(true)
})

it('emits details event when details button clicked', async () => {
const wrapper = mount(AppStoreCard, {
props: { app: mockApp }
})

await wrapper.trigger('mouseenter')
await wrapper.find('button:first-of-type').trigger('click')

expect(wrapper.emitted('details')).toBeTruthy()
expect(wrapper.emitted('details')[0]).toEqual([mockApp])
})

it('emits add event when add button clicked', async () => {
const wrapper = mount(AppStoreCard, {
props: { app: mockApp }
})

await wrapper.trigger('mouseenter')
const buttons = wrapper.findAll('button')
await buttons[1].trigger('click')

expect(wrapper.emitted('add')).toBeTruthy()
expect(wrapper.emitted('add')[0]).toEqual([mockApp])
})

it('displays tags correctly', () => {
const wrapper = mount(AppStoreCard, {
props: { app: mockApp }
})

const badges = wrapper.findAll('.badge')
expect(badges.length).toBe(2)
expect(badges[0].text()).toBe('productivity')
expect(badges[1].text()).toBe('forms')
})
})

File: resources/js/Components/Mod/AppStoreModal/__tests__/AppStoreSourceFilter.test.js

import { describe, it, expect } from 'vitest'
import { mount } from '@vue/test-utils'
import AppStoreSourceFilter from '../AppStoreSourceFilter.vue'

describe('AppStoreSourceFilter', () => {
it('renders all three filter options', () => {
const wrapper = mount(AppStoreSourceFilter, {
props: { modelValue: 'all' }
})

const buttons = wrapper.findAll('button')
expect(buttons.length).toBe(3)
expect(buttons[0].text()).toContain('All Apps')
expect(buttons[1].text()).toContain('Public Only')
expect(buttons[2].text()).toContain('My Team Only')
})

it('emits update when button clicked', async () => {
const wrapper = mount(AppStoreSourceFilter, {
props: { modelValue: 'all' }
})

const buttons = wrapper.findAll('button')
await buttons[1].trigger('click')

expect(wrapper.emitted('update:modelValue')).toBeTruthy()
expect(wrapper.emitted('update:modelValue')[0]).toEqual(['public'])
})

it('shows active state on correct button', () => {
const wrapper = mount(AppStoreSourceFilter, {
props: { modelValue: 'public' }
})

const buttons = wrapper.findAll('button')
expect(buttons[0].classes()).not.toContain('active')
expect(buttons[1].classes()).toContain('active')
expect(buttons[2].classes()).not.toContain('active')
})
})

File: resources/js/Components/Mod/AppStoreModal/__tests__/AppStoreSidebar.test.js

import { describe, it, expect } from 'vitest'
import { mount } from '@vue/test-utils'
import AppStoreSidebar from '../AppStoreSidebar.vue'

describe('AppStoreSidebar', () => {
const mockTags = [
{ id: 1, name: 'Productivity' },
{ id: 2, name: 'Forms' },
{ id: 3, name: 'Analytics' }
]

it('renders search input', () => {
const wrapper = mount(AppStoreSidebar, {
props: {
search: '',
selectedTags: [],
tags: mockTags
}
})

expect(wrapper.find('input[type="text"]').exists()).toBe(true)
})

it('emits search update when typing', async () => {
const wrapper = mount(AppStoreSidebar, {
props: {
search: '',
selectedTags: [],
tags: mockTags
}
})

const input = wrapper.find('input[type="text"]')
await input.setValue('test')

expect(wrapper.emitted('update:search')).toBeTruthy()
expect(wrapper.emitted('update:search')[0]).toEqual(['test'])
})

it('renders all tags', () => {
const wrapper = mount(AppStoreSidebar, {
props: {
search: '',
selectedTags: [],
tags: mockTags
}
})

const tagItems = wrapper.findAll('.tag-item')
expect(tagItems.length).toBe(3)
})

it('toggles tag selection', async () => {
const wrapper = mount(AppStoreSidebar, {
props: {
search: '',
selectedTags: [],
tags: mockTags
}
})

const firstTag = wrapper.findAll('.tag-item')[0]
await firstTag.trigger('click')

expect(wrapper.emitted('update:selectedTags')).toBeTruthy()
expect(wrapper.emitted('update:selectedTags')[0][0]).toContain('Productivity')
})

it('shows clear button when tags selected', () => {
const wrapper = mount(AppStoreSidebar, {
props: {
search: '',
selectedTags: ['Productivity'],
tags: mockTags
}
})

expect(wrapper.find('button').exists()).toBe(true)
expect(wrapper.find('button').text()).toContain('Clear')
})
})

Run component tests:

docker compose exec vite npm run test:unit

Step 2: Accessibility Improvements​

Update AppStoreModal.vue:

<!-- Add aria labels and roles -->
<div
class="modal fade app-store-modal"
role="dialog"
aria-labelledby="app-store-modal-title"
aria-modal="true"
:class="{ show: isOpen }"
:style="{ display: isOpen ? 'block' : 'none' }"
tabindex="-1"
@click.self="closeModal"
>
<div class="modal-dialog modal-xl modal-dialog-scrollable">
<div class="modal-content">
<div class="modal-header">
<h5 id="app-store-modal-title" class="modal-title">
{{ modalTitle }}
</h5>
<button
type="button"
class="btn-close"
aria-label="Close app store"
@click="closeModal"
></button>
</div>
<!-- ... rest of template -->
</div>
</div>
</div>

Update AppStoreCard.vue:

<!-- Add accessible button labels -->
<button
type="button"
class="btn btn-outline-primary btn-sm me-2"
:aria-label="`View details for ${app.name}`"
@click.stop="$emit('details', app)"
>
<FontAwesomeIcon icon="info-circle" class="me-1" />
Details
</button>
<button
type="button"
class="btn btn-primary btn-sm"
:aria-label="`Add ${app.name} to project`"
@click.stop="$emit('add', app)"
>
<FontAwesomeIcon icon="plus" class="me-1" />
Add
</button>

Add keyboard navigation to AppStoreSidebar.vue:

<div
v-for="tag in tags"
:key="tag.id"
class="tag-item px-3 py-2 rounded cursor-pointer user-select-none"
role="button"
tabindex="0"
:aria-pressed="selectedTags.includes(tag.name)"
:class="{
'bg-primary text-white': selectedTags.includes(tag.name),
'bg-white border': !selectedTags.includes(tag.name)
}"
@click="toggleTag(tag.name)"
@keydown.enter="toggleTag(tag.name)"
@keydown.space.prevent="toggleTag(tag.name)"
>
{{ tag.name }}
</div>

Step 3: UI/UX Polish​

Add loading skeleton to AppStoreGrid.vue:

<!-- Add before app-grid -->
<div v-if="loading" class="row g-3">
<div
v-for="i in 6"
:key="i"
class="col-12 col-md-6 col-lg-4"
>
<div class="card h-100">
<div class="card-body">
<div class="skeleton skeleton-icon mb-3"></div>
<div class="skeleton skeleton-title mb-2"></div>
<div class="skeleton skeleton-text"></div>
</div>
</div>
</div>
</div>

Add skeleton styles:

.skeleton {
animation: skeleton-loading 1s linear infinite alternate;
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
background-size: 200% 100%;
border-radius: 4px;
}

.skeleton-icon {
width: 64px;
height: 64px;
border-radius: 50%;
}

.skeleton-title {
height: 24px;
width: 70%;
}

.skeleton-text {
height: 16px;
width: 100%;
}

@keyframes skeleton-loading {
0% {
background-position: 200% 0;
}
100% {
background-position: -200% 0;
}
}

Add smooth scroll to modal body:

.modal-body {
scroll-behavior: smooth;
}

Add focus styles:

.app-card:focus-visible,
.tag-item:focus-visible,
button:focus-visible {
outline: 2px solid var(--bs-primary);
outline-offset: 2px;
}

Step 4: Performance Optimization​

Add debounce to search in AppStoreSidebar.vue:

import { debounce } from 'lodash-es'

const debouncedEmit = debounce((value) => {
emit('update:search', value)
}, 300)

const handleSearchInput = (event) => {
debouncedEmit(event.target.value)
}

Lazy load images in AppStoreDetails.vue:

<img
:src="screenshot.url"
:alt="screenshot.caption"
loading="lazy"
class="img-fluid rounded cursor-pointer"
@click="openLightbox(screenshot)"
/>

Step 5: Error Handling Improvements​

Add error boundaries in AppStoreModal.vue:

const handleApiError = (err, context) => {
console.error(`Error in ${context}:`, err)

let message = 'An unexpected error occurred'

if (err.response?.status === 404) {
message = 'Resource not found'
} else if (err.response?.status === 403) {
message = 'You do not have permission to perform this action'
} else if (err.response?.status === 422) {
message = 'Please check your input and try again'
} else if (err.response?.data?.message) {
message = err.response.data.message
}

toast.error(message)
}

// Use in loadInitialData, showDetails, etc.
catch (err) {
handleApiError(err, 'loading app store data')
}

Step 6: Final QA Testing Checklist​

Functionality:

  • Browse view displays apps correctly
  • Source filter works (all/public/team)
  • Search filters by name
  • Tags filter with OR logic
  • View mode toggle persists
  • Details view loads and displays correctly
  • Markdown renders properly
  • Screenshots lightbox works
  • Configuration form validates
  • Form submission creates page with all options
  • Dependencies are created/attached
  • Portal nav, shortcuts, tiles work

UI/UX:

  • All animations are smooth
  • Loading states show appropriately
  • Empty states display correctly
  • Error messages are helpful
  • Modal closes properly
  • Body scroll locks when modal open
  • Responsive on mobile, tablet, desktop
  • Focus management works correctly
  • Keyboard navigation works

Accessibility:

  • Screen reader announces modal properly
  • All interactive elements have aria labels
  • Keyboard navigation works throughout
  • Focus indicators are visible
  • Color contrast meets WCAG standards
  • Tab order is logical

Performance:

  • No console errors or warnings
  • Images lazy load
  • Search is debounced
  • API calls are optimized
  • No memory leaks on modal close

Edge Cases:

  • Works with apps that have no tags
  • Works with apps that have no screenshots
  • Works with apps that have no readme
  • Works with apps that have no dependencies
  • Handles API failures gracefully
  • Handles network errors
  • Works when no dashboards exist
  • Works when no portal exists

Step 7: Update Documentation​

Create user guide:

File: docs/features/app-store/user-guide.md

Brief guide on how to use the app store:

  • How to browse apps
  • How to filter by source/tags
  • How to view app details
  • How to install an app
  • How to configure app options

Update JIRA ticket EZ-2206:

  • Add link to design document
  • Add link to phase plans
  • Mark as complete
  • Add any notes about known limitations

Acceptance Criteria​

  • All component tests pass
  • All feature tests pass
  • Accessibility audit passes
  • No console errors or warnings
  • Performance is acceptable (< 2s to load apps)
  • UI polish is complete
  • Documentation is updated
  • Final QA checklist is complete
  • JIRA ticket is updated

Files Created​

  • resources/js/Components/Mod/AppStoreModal/__tests__/AppStoreCard.test.js
  • resources/js/Components/Mod/AppStoreModal/__tests__/AppStoreSourceFilter.test.js
  • resources/js/Components/Mod/AppStoreModal/__tests__/AppStoreSidebar.test.js
  • docs/features/app-store/user-guide.md

Files Modified​

  • All component files with accessibility and polish improvements

Deployment​

After all acceptance criteria are met:

  1. Create pull request
  2. Request code review
  3. Address feedback
  4. Merge to develop/staging
  5. Test on staging environment
  6. Deploy to production
  7. Monitor for issues

Success Metrics​

Track these metrics after deployment:

  • App installation success rate
  • Time to install an app
  • Most popular apps
  • Filter usage (tags, source)
  • Error rates
  • User feedback