`@sapui5/ts-types-esm` - `PageObjectDefinition.actions` & `assertions` function types should have a `this` parameter

Abierto
#307 1 comentario 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
42/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
typescript
Área
tooling

Línea de trabajo

Start at the @sapui5/ts-types-esm definition of PageObjectDefinition and inspect the actions and assertions function types. Compare them with the Opa5.createPageObjects example linked in the issue, then verify that its this.waitFor call compiles once the this type is represented.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

types
export type PageObjectDefinition = {
    //...
    actions?: Record<string, (this: Opa5) => void>;
    assertions?: Record<string, (this: Opa5) => void>;
}

otherwise this example won't compile bcause the this type is not defined:

Opa5.createPageObjects({
    onTheAppPage: {
        actions: {},

        assertions: {
            iShouldSeeTheApp: function () {
                // error: Cannot invoke an object which is possibly 'undefined'
                this.waitFor({
                    id: 'myButton',
                    actions: function () {},
                    success: function () {},
                })
            },
        },
    },
})
Lenguaje dominante
TypeScript
Estrellas
213
Forks
35
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de UI5/typescript

Todos los issues de UI5/typescript

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.