mirror of
https://github.com/sky-systems/sky_phone.git
synced 2026-09-04 17:23:25 +00:00
ADD - introduce advanced phone setup and reset flow
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { readFileSync } from 'node:fs'
|
||||
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
const source = readFileSync(
|
||||
new URL('./PhoneSetupAssistant.vue', import.meta.url),
|
||||
'utf8',
|
||||
)
|
||||
|
||||
describe('PhoneSetupAssistant contract', () => {
|
||||
it('uses first-party controls and exposes the complete setup journey', () => {
|
||||
expect(source).not.toContain("from 'konsta/vue'")
|
||||
expect(source).toContain('PhonePasscode')
|
||||
expect(source).toContain("step === 1")
|
||||
expect(source).toContain("step === 8")
|
||||
expect(source).toContain("['performance', 'ultimate']")
|
||||
expect(source).toContain('WALLPAPER_IDS')
|
||||
expect(source).toContain('setAllAppNotifications')
|
||||
expect(source).toContain('appStore.claimApp')
|
||||
expect(source).toContain('phone.completeSetup()')
|
||||
})
|
||||
|
||||
it('persists progress and supports resuming or moving backward', () => {
|
||||
expect(source).toContain('phone.preferences.settings.setupStep')
|
||||
expect(source).toContain('phone.setSetupStep(step.value)')
|
||||
expect(source).toContain('@click="moveTo(step - 1)"')
|
||||
})
|
||||
})
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,11 +9,13 @@ const props = withDefaults(
|
||||
defineProps<{
|
||||
activeCallReturn?: boolean
|
||||
controlCenterOpened?: boolean
|
||||
interactive?: boolean
|
||||
lockable?: boolean
|
||||
}>(),
|
||||
{
|
||||
activeCallReturn: false,
|
||||
controlCenterOpened: false,
|
||||
interactive: true,
|
||||
lockable: false,
|
||||
},
|
||||
)
|
||||
@@ -30,6 +32,7 @@ function updateTime(): void {
|
||||
}
|
||||
|
||||
function handleTimeClick(): void {
|
||||
if (!props.interactive) return
|
||||
if (props.activeCallReturn) {
|
||||
emit('activeCall')
|
||||
return
|
||||
@@ -76,7 +79,8 @@ onBeforeUnmount(() => {
|
||||
type="button"
|
||||
:aria-label="phone.t('ControlCenter.open')"
|
||||
:aria-expanded="controlCenterOpened"
|
||||
@click.stop="emit('controlCenter')"
|
||||
:disabled="!interactive"
|
||||
@click.stop="interactive && emit('controlCenter')"
|
||||
>
|
||||
<PhoneStatusIndicators
|
||||
:airplane-mode="phone.preferences.settings.airplaneMode"
|
||||
|
||||
Reference in New Issue
Block a user