Osama Sayegh
a53d8d3e61
FEATURE: Introduce theme/component QUnit tests ( #12517 )
...
This commit allows themes and theme components to have QUnit tests. To add tests to your theme/component, create a top-level directory in your theme and name it `test`, and Discourse will save all the files in that directory (and its sub-directories) as "tests files" in the database. While tests files/directories are not required to be organized in a specific way, we recommend that you follow Discourse core's tests [structure](https://github.com/discourse/discourse/tree/master/app/assets/javascripts/discourse/tests ).
Writing theme tests should be identical to writing plugins or core tests; all the `import` statements and APIs that you see in core (or plugins) to define/setup tests should just work in themes.
You do need a working Discourse install to run theme tests, and you have 2 ways to run theme tests:
* In the browser at the `/qunit` route. `/qunit` will run tests of all active themes/components as well as core and plugins. The `/qunit` now accepts a `theme_name` or `theme_url` params that you can use to run tests of a specific theme/component like so: `/qunit?theme_name=<your_theme_name>`.
* In the command line using the `themes:qunit` rake task. This take is meant to run tests of a single theme/component so you need to provide it with a theme name or URL like so: `bundle exec rake themes:qunit[name=<theme_name>]` or `bundle exec rake themes:qunit[url=<theme_url>]`.
There are some refactors to internal code that's responsible for processing themes/components in Discourse, most notably:
* `<script type="text/discourse-plugin">` tags are automatically converted to modules.
* The `theme-settings` service is removed in favor of a simple `lib` file responsible for managing theme settings. This was done to allow us to register/lookup theme settings very early in our Ember app lifecycle and because there was no reason for it to be an Ember service.
These refactors should 100% backward compatible and invisible to theme developers.
2021-04-07 10:39:57 +03:00
..
2021-02-08 10:04:33 +00:00
2021-03-30 23:12:53 +02:00
2021-02-03 17:41:47 +01:00
2019-08-28 12:37:42 +01:00
2019-05-13 09:31:32 +08:00
2020-07-20 15:23:49 -06:00
2019-05-29 14:26:24 +10:00
2021-02-22 20:10:53 -03:00
2020-10-19 10:40:55 +01:00
2020-05-23 00:56:13 -04:00
2019-10-02 14:01:53 +10:00
2019-10-17 16:58:21 +11:00
2019-10-17 16:58:21 +11:00
2019-05-13 09:31:32 +08:00
2019-10-02 14:01:53 +10:00
2020-09-10 21:37:48 +02:00
2019-05-13 09:31:32 +08:00
2019-05-13 09:31:32 +08:00
2021-03-17 08:55:23 +03:00
2020-09-23 12:00:07 +03:00
2021-03-22 09:50:22 +10:00
2019-05-13 09:31:32 +08:00
2019-05-13 09:31:32 +08:00
2020-06-24 15:51:30 +10:00
2019-10-23 10:30:43 +01:00
2021-03-30 11:42:26 -04:00
2019-05-13 09:31:32 +08:00
2019-05-13 09:31:32 +08:00
2019-05-13 09:31:32 +08:00
2019-05-13 09:31:32 +08:00
2019-05-13 09:31:32 +08:00
2020-08-20 00:35:04 +05:30
2021-01-12 17:28:33 +02:00
2019-05-13 09:31:32 +08:00
2020-08-20 17:10:33 -07:00
2020-08-07 08:52:47 -04:00
2020-12-02 09:22:30 -06:00
2020-04-28 15:59:39 +05:30
2019-11-29 15:49:08 +00:00
2019-10-02 14:01:53 +10:00
2020-03-30 14:34:48 -04:00
2021-03-11 10:38:34 +00:00
2019-05-13 09:31:32 +08:00
2021-02-04 11:27:34 +11:00
2020-12-18 09:03:51 -06:00
2021-03-05 13:40:00 -06:00
2021-03-19 09:19:15 -04:00
2021-04-01 16:39:28 +05:30
2019-10-02 14:01:53 +10:00
2020-06-11 14:54:11 +03:00
2019-10-23 19:22:33 -04:00
2019-05-13 15:16:53 +05:30
2020-08-21 11:36:53 +08:00
2020-07-27 10:23:54 +10:00
2021-02-26 07:44:52 -05:00
2021-03-02 16:04:16 -03:00
2019-05-13 09:31:32 +08:00
2020-12-23 13:14:19 +11:00
2020-07-10 12:05:55 +03:00
2020-08-06 12:27:27 -04:00
2019-05-13 09:31:32 +08:00
2019-05-13 09:31:32 +08:00
2019-05-13 09:31:32 +08:00
2019-05-13 09:31:32 +08:00
2019-05-13 09:31:32 +08:00
2020-08-06 12:27:27 -04:00
2020-10-27 23:42:33 +05:30
2021-02-18 17:24:44 -03:00
2020-11-03 12:38:54 +00:00
2021-01-21 11:37:47 +10:00
2019-05-14 17:44:53 +02:00
2021-01-21 12:59:50 +10:00
2019-10-21 12:08:20 +01:00
2020-04-22 11:52:50 +03:00
2019-05-13 09:31:32 +08:00
2021-03-09 09:27:18 +08:00
2021-03-25 18:26:22 +02:00
2021-03-09 00:15:14 +02:00
2021-03-06 13:29:35 +02:00
2020-10-09 12:51:24 +01:00
2019-10-02 14:01:53 +10:00
2020-11-02 12:18:48 +05:30
2021-01-20 21:32:22 +01:00
2019-10-02 14:01:53 +10:00
2019-05-13 09:31:32 +08:00
2019-10-02 14:01:53 +10:00
2019-10-02 14:01:53 +10:00
2021-01-27 10:29:24 -06:00
2019-10-25 11:57:34 +11:00
2019-05-13 09:31:32 +08:00
2020-12-21 20:09:00 -03:00
2021-03-29 13:36:59 -05:00
2019-05-13 09:31:32 +08:00
2019-05-13 09:31:32 +08:00
2019-10-02 14:01:53 +10:00
2020-07-08 15:27:42 +10:00
2020-08-07 12:08:59 -04:00
2019-05-13 15:24:24 +01:00
2019-05-13 09:31:32 +08:00
2021-03-29 11:25:48 +10:00
2019-05-13 09:31:32 +08:00
2020-11-09 15:57:59 +11:00
2019-10-02 14:01:53 +10:00
2020-10-27 23:42:33 +05:30
2019-05-13 09:31:32 +08:00
2021-02-23 11:36:00 -03:00
2019-05-13 09:31:32 +08:00
2021-03-24 10:22:16 -05:00
2019-10-02 14:01:53 +10:00
2020-06-17 12:42:20 +02:00
2019-05-13 09:31:32 +08:00
2020-05-05 13:46:57 +10:00
2021-03-10 20:15:04 -05:00
2019-10-02 14:01:53 +10:00
2020-12-09 10:54:41 -06:00
2020-01-09 12:32:05 -05:00
2020-09-01 13:41:04 +05:30
2020-02-10 15:40:01 -08:00
2019-10-02 14:01:53 +10:00
2020-09-01 13:41:04 +05:30
2020-07-02 11:47:43 -03:00
2019-10-02 14:01:53 +10:00
2021-02-22 18:37:47 +05:30
2021-02-26 07:56:14 -03:00
2021-03-22 10:22:29 +01:00
2020-10-27 23:42:33 +05:30
2020-07-27 10:23:54 +10:00
2019-10-02 14:01:53 +10:00
2019-12-03 10:05:53 +01:00
2019-05-13 09:31:32 +08:00
2021-01-27 10:29:24 -06:00
2019-05-13 09:31:32 +08:00
2020-09-24 01:58:53 +03:00
2019-12-03 10:05:53 +01:00
2020-05-27 17:09:40 +02:00
2019-10-02 14:01:53 +10:00
2020-07-21 12:20:23 +08:00
2019-05-13 09:31:32 +08:00
2019-05-13 09:31:32 +08:00
2020-03-13 12:25:58 -04:00
2019-05-13 09:31:32 +08:00
2020-08-06 12:27:27 -04:00
2021-03-10 21:13:15 -05:00
2021-04-07 10:39:57 +03:00
2020-10-27 23:42:33 +05:30
2020-04-15 18:34:02 +05:30
2020-12-17 11:02:41 +11:00
2021-04-07 10:39:57 +03:00
2019-05-13 09:31:32 +08:00
2019-05-13 09:31:32 +08:00
2019-10-02 14:01:53 +10:00
2019-05-13 09:31:32 +08:00
2019-05-13 09:31:32 +08:00
2020-04-03 16:42:01 +01:00
2020-10-27 23:42:33 +05:30
2021-03-12 12:42:32 -06:00
2019-05-13 09:31:32 +08:00
2019-12-13 11:51:40 -05:00
2019-05-13 09:31:32 +08:00
2020-10-27 23:42:33 +05:30
2020-12-29 15:54:05 +11:00
2021-03-30 11:42:26 -04:00
2019-05-13 09:31:32 +08:00
2020-07-17 10:48:08 +01:00
2021-02-02 10:50:04 +01:00
2021-02-02 10:50:04 +01:00
2019-05-13 09:31:32 +08:00
2019-05-13 09:31:32 +08:00
2020-05-26 16:19:05 +10:00
2021-02-18 11:52:30 +10:00
2021-03-10 21:13:15 -05:00
2021-02-24 10:50:02 +01:00
2020-04-07 17:36:07 -04:00
2021-04-07 00:01:15 +03:00
2021-03-25 14:00:05 -04:00
2020-08-12 11:28:34 -03:00
2019-10-02 14:01:53 +10:00
2021-01-27 14:31:19 +00:00
2019-05-13 09:31:32 +08:00
2021-03-01 11:44:00 -05:00
2020-10-27 23:42:33 +05:30
2020-10-21 19:44:34 +01:00
2020-10-27 23:42:33 +05:30
2019-05-13 09:31:32 +08:00
2019-05-13 09:31:32 +08:00
2019-05-13 09:31:32 +08:00
2019-11-27 12:39:31 +00:00
2020-10-09 12:51:24 +01:00
2020-04-28 15:59:39 +05:30
2019-05-13 09:31:32 +08:00
2021-01-19 08:53:49 +10:00
2020-10-27 23:42:33 +05:30
2021-02-22 11:42:37 +00:00
2019-07-25 19:41:25 +05:30
2019-05-13 09:31:32 +08:00
2019-05-13 09:31:32 +08:00
2020-10-27 23:42:33 +05:30
2020-10-27 23:42:33 +05:30
2021-01-22 13:02:11 -06:00
2020-02-07 17:32:35 +00:00
2021-02-15 08:50:33 +11:00
2019-12-03 10:05:53 +01:00
2020-07-27 10:23:54 +10:00
2019-05-13 09:31:32 +08:00
2021-01-25 21:27:15 +01:00
2020-01-10 10:45:56 +10:00
2019-10-17 16:58:22 +11:00
2020-10-27 23:42:33 +05:30
2021-03-02 11:55:07 +11:00
2019-05-13 09:31:32 +08:00
2019-05-13 09:31:32 +08:00
2019-05-13 09:31:32 +08:00
2021-03-29 14:03:19 +03:00
2020-07-27 10:23:54 +10:00
2021-03-22 22:32:18 +02:00
2019-12-03 10:05:53 +01:00
2020-05-23 00:56:13 -04:00
2019-05-13 09:31:32 +08:00
2021-03-04 21:41:57 +00:00