test: add deterministic resilience matrix
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, nextTick, onUnmounted, ref, shallowRef, watch } from 'vue';
|
||||
import { useLazyMedia } from '@/composables/useLazyMedia';
|
||||
import { isTestFault, recordTestFaultEvent } from '@/testing/fault-hooks';
|
||||
|
||||
declare const __PORTFOLIO_TEST_BUILD__: boolean;
|
||||
const TEST_BUILD = typeof __PORTFOLIO_TEST_BUILD__ !== 'undefined' && __PORTFOLIO_TEST_BUILD__;
|
||||
|
||||
export interface AccessibleVideoSource {
|
||||
src: string;
|
||||
@@ -64,6 +68,11 @@ const markUnavailable = (): void => {
|
||||
|
||||
const play = async (): Promise<void> => {
|
||||
if (unavailable.value) return;
|
||||
if (TEST_BUILD && isTestFault('F8-video-failure')) {
|
||||
recordTestFaultEvent('video-failure');
|
||||
markUnavailable();
|
||||
return;
|
||||
}
|
||||
lazy.requestExplicit();
|
||||
status.value = 'Loading video.';
|
||||
await nextTick();
|
||||
|
||||
Reference in New Issue
Block a user