Skip to content
This repository was archived by the owner on Jul 2, 2021. It is now read-only.
This repository was archived by the owner on Jul 2, 2021. It is now read-only.

Write test for image path schema #13

Description

@scytherswings

The regex
const IMAGE_KEY_PATTERN_REGEX = /(([\/a-zA-Z0-9]+)\/([a-zA-Z0-9]+))_((\d+|auto)x(\d+|auto))(\.jpeg|\.jpg|\.png)/;

Is large and needs to be tested to make sure future changes don't break our filename schema.
The way images are currently resolved is by taking the s3 path of the failed image request, usually something like raw/1283ds7320dofiuasdofisddgn_400x300 and extracting the original file from it.
In this case it would be 1283ds7320dofiuasdofisddgn and we know that the user wants an image that is 400 pixels wide by 300 tall, respecting the aspect ratio (this is not the scope of this test though).

We need a test that will ensure that requests coming in for new image sizes are parsed and the original image path is extracted correctly.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions