mattermost / mattermost-plugin-google-calendar

Mattermost Google Calendar Plugin
33 stars 31 forks source link

Test for importing webapp externally #57

Closed mickmister closed 2 months ago

mickmister commented 9 months ago

Summary

In order to share frontend code between calendar projects, we need to have a way to reference the source code of the shared package. This PR introduces a postinstall script that checks out the shared repo as an npm dependency, so that the common calendar logic can be imported by the gcal repo. By defining the postinstall script, we do the following whenever npm install is run:

The index.tsx file on this bare-webapp branch does not define a Plugin object to provide to registerPlugin. It instead imports the one provided by the cloned module, and uses that to call registerPlugin. Note that the commit https://github.com/mattermost/mattermost-plugin-google-calendar/commit/157e79683b910d1af2f38fbec06236ef3a9c62a9 being imported avoids calling registerPlugin in its index.tsx file

Ticket Link

codecov-commenter commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (7de5e03) 11.22% compared to head (14e7924) 11.22%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #57 +/- ## ======================================= Coverage 11.22% 11.22% ======================================= Files 16 16 Lines 606 606 ======================================= Hits 68 68 Misses 536 536 Partials 2 2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.