1- import type { AuthContextInput } from './types.js'
1+ import type { AuthContextInput , ColorSchemePreference , ReducedMotionPreference } from './types.js'
22import * as core from '@actions/core'
33import { AuthContext } from './AuthContext.js'
44import { findForUrl } from './findForUrl.js'
@@ -12,20 +12,24 @@ export default async function () {
1212
1313 const includeScreenshots = core . getInput ( 'include_screenshots' , { required : false } ) !== 'false'
1414 const reducedMotionInput = core . getInput ( 'reduced_motion' , { required : false } )
15- let reducedMotion : 'reduce' | 'no-preference' | undefined
15+ let reducedMotion : ReducedMotionPreference | undefined
1616 if ( reducedMotionInput ) {
17- if ( ! [ 'reduce' , 'no-preference' ] . includes ( reducedMotionInput ) ) {
18- throw new Error ( "Input 'reduced_motion' must be one of: 'reduce', 'no-preference'" )
17+ if ( ! [ 'reduce' , 'no-preference' , null ] . includes ( reducedMotionInput ) ) {
18+ throw new Error (
19+ "Input 'reduced_motion' must be one of: 'reduce', 'no-preference', or null per Playwright documentation." ,
20+ )
1921 }
20- reducedMotion = reducedMotionInput as 'reduce' | 'no-preference'
22+ reducedMotion = reducedMotionInput as ReducedMotionPreference
2123 }
2224 const colorSchemeInput = core . getInput ( 'color_scheme' , { required : false } )
23- let colorScheme : 'light' | 'dark' | 'no-preference' | undefined
25+ let colorScheme : ColorSchemePreference | undefined
2426 if ( colorSchemeInput ) {
25- if ( ! [ 'light' , 'dark' , 'no-preference' ] . includes ( colorSchemeInput ) ) {
26- throw new Error ( "Input 'color_scheme' must be one of: 'light', 'dark', 'no-preference'" )
27+ if ( ! [ 'light' , 'dark' , 'no-preference' , null ] . includes ( colorSchemeInput ) ) {
28+ throw new Error (
29+ "Input 'color_scheme' must be one of: 'light', 'dark', 'no-preference', or null per Playwright documentation." ,
30+ )
2731 }
28- colorScheme = colorSchemeInput as 'light' | 'dark' | 'no-preference'
32+ colorScheme = colorSchemeInput as ColorSchemePreference
2933 }
3034
3135 const findings = [ ]
0 commit comments