Skip to content

[Docs] Test helpers: uploadFile helper usage #146

@tniezurawski

Description

@tniezurawski

When you look at README.md you will see at the end of "Test helpers" section line of code with uploadFile helper usage:

uploadFile(content, filename, lastModifiedDate);

Look at the source of test-support/helpers/ember-cli-file-picker.js and createFile function that uses options:

function createFile(content = ['test'], options = {}) {
  const {
    name,
    type,
    lastModifiedDate
  } = options;
...
}

and createFile usage within the helper:

const uploadFile = Ember.Test.registerAsyncHelper('uploadFile', function(app, content, options) {
   const file = createFile(content, options);
...
}

I think that options should be passed as object:

uploadFile(content, {name: filename, type: type, lastModifiedDate: lastModifiedDate});

BTW Please look at Pull Request with very needed changes for test-support/helpers/ember-cli-file-picker.js.

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