mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
REFACTOR: Remove .erb
file from javascript tests
We can't use erb in Ember CLI (since it does not have Ruby) so this has been ported to use our `javascript:update_constants` rake test instead. Note we don't have to run this every time a notification type as it's only used by fixtures to fill in some specific types we test against.
This commit is contained in:
@ -168,6 +168,16 @@ task 'javascript:update_constants' => :environment do
|
||||
export const SEARCH_PHRASE_REGEXP = '#{Search::PHRASE_MATCH_REGEXP_PATTERN}';
|
||||
JS
|
||||
|
||||
pretty_notifications = Notification.types.map do |n|
|
||||
" #{n[0]}: #{n[1]},"
|
||||
end.join("\n")
|
||||
|
||||
write_template("discourse/tests/fixtures/concerns/notification-types.js", task_name, <<~JS)
|
||||
export const NOTIFICATION_TYPES = {
|
||||
#{pretty_notifications}
|
||||
};
|
||||
JS
|
||||
|
||||
write_template("pretty-text/addon/emoji/data.js", task_name, <<~JS)
|
||||
export const emojis = #{Emoji.standard.map(&:name).flatten.inspect};
|
||||
export const tonableEmojis = #{Emoji.tonable_emojis.flatten.inspect};
|
||||
|
Reference in New Issue
Block a user