Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to import Froala Editor inside tests with own installation of ember-auto-import. #91

Closed
fran-worley opened this issue Dec 9, 2020 · 3 comments

Comments

@fran-worley
Copy link

When importing froala editor inside ember tests it seems to use the editor imported by auto import, which doesn't include any plugin and uses a different configuration from the one used normally by ember-froala-editor (the one provided by its shim)

To get our tests to work correctly, we have had to disable the froala-editor package from ember-auto-import in our ember-cli-build as follows:

    autoImport: {
      exclude: ['froala-editor']
    }

I would suggest that this step either needs to be explicit in the readme, or revise your use of ember-auto-import to follow standard ember conventions and avoid this unnecessary step.

@Panman82
Copy link
Contributor

Panman82 commented Dec 9, 2020

Are you saying ember-auto-import is trying to import the file again, even though it is included by ember-cli? What kind of tests? Can you provide an example (I'll replicate the issue)?

I'll have to take a look at ember-auto-import again. I know the last time I tried to bring it into this addon it didn't work, due to the froala editor files needing to be imported in a certain order (and optionally based upon config). So it was easier to continue using the ember-cli this.import functionality.

@fran-worley
Copy link
Author

Hi @Panman82,

Thank you for coming back so quickly. Essentially when without disabling ember-auto-import from attempting to import ember-froala-editor, the editor is rendered without our build config (so chosen plugins, languages etc).

For us, this was a specific issue in a series of integration component tests we were writing to cover our use of the image plugin and how it is integrated into our server. These failed initially because the image plugin wasn't being loaded in our test environment even though it was fine in development.

I haven't actually debugged the import process in development as the end result works, our test environment (which is a totally standard ember-cli driven app on version 3.20+) just failed to load the froala build config until we disabled ember-auto-import.

@Panman82
Copy link
Contributor

Panman82 commented Jan 8, 2021

Ok, so I think it would be better to instead move this addon to entirely use auto-import. I haven't done this yet from the addon perspective, so I'll have to dig into it. Let me know if you have any suggestions on where to start and such. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants