Options
All
  • Public
  • Public/Protected
  • All
Menu

Module TestUtils

This file contains different things that help our testing for the server.

Index

Functions

createStaffUser

  • createStaffUser(nationId: number, nationAdmin: boolean): Promise<{ oid: any; scope: any; token: any; user: default }>
  • Function that creates a staff user to use in testing

    Parameters

    • nationId: number

      The id the user will be apart of

    • nationAdmin: boolean

      If the user is suppsoed to be a regular staff user or an admin in the nation

    Returns Promise<{ oid: any; scope: any; token: any; user: default }>

createTestCategory

  • createTestCategory(): Promise<default>

createTestContact

  • createTestContact(oid: number): Promise<default>

createTestEvent

  • createTestEvent(oid: number, occursAt?: DateTime, category?: boolean): Promise<default>
  • Function that creates a test event to test with

    Parameters

    • oid: number

      The nation the event will be from

    • Optional occursAt: DateTime

      The given date the event will occur at

    • Optional category: boolean

    Returns Promise<default>

createTestExceptionOpeningHour

  • createTestExceptionOpeningHour(lid: number): Promise<default>
  • Function that creates a test opening hour exception to test with

    Parameters

    • lid: number

      The location the openingHour will be from

    Returns Promise<default>

createTestIndividual

  • createTestIndividual(oid: number): Promise<default>

createTestLocation

  • createTestLocation(oid: number): Promise<default>
  • Function that creates a test location to test with

    Parameters

    • oid: number

      The nation the location will be from

    Returns Promise<default>

createTestMenu

  • createTestMenu(oid: number, lid: number): Promise<default>
  • Function that creates a test menu

    Parameters

    • oid: number

      The nation the menu will be apart of

    • lid: number

      The location the menu will be apart of

    Returns Promise<default>

createTestMenuItem

  • createTestMenuItem(mid: number): Promise<default>
  • Creates a test MenuItem

    Parameters

    • mid: number

      menu id for where the menuItem is to be placed within

    Returns Promise<default>

createTestNation

createTestOpeningHour

  • createTestOpeningHour(lid: number): Promise<default>
  • Function that creates a test opening hour to test with

    Parameters

    • lid: number

      The location the openingHour will be from

    Returns Promise<default>

toRelativePath

  • toRelativePath(absolutePath: string): string
  • Extracts the relative path given an absolutePath

    Parameters

    • absolutePath: string

      the absolute path

    Returns string

Generated using TypeDoc