diff --git a/Gemfile.lock b/Gemfile.lock index 4a518e23..c78b8a6e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,82 +1,79 @@ GEM remote: https://rubygems.org/ specs: - activesupport (7.1.3.3) + activesupport (7.2.1.1) base64 bigdecimal - concurrent-ruby (~> 1.0, >= 1.0.2) + concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) - mutex_m - tzinfo (~> 2.0) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) ast (2.4.2) base64 (0.2.0) bigdecimal (3.1.8) - concurrent-ruby (1.2.3) + concurrent-ruby (1.3.4) connection_pool (2.4.1) drb (2.2.1) - i18n (1.14.5) + i18n (1.14.6) concurrent-ruby (~> 1.0) json (2.7.2) language_server-protocol (3.17.0.3) - minitest (5.23.1) - mutex_m (0.2.0) - parallel (1.24.0) - parser (3.3.1.0) + logger (1.6.1) + minitest (5.25.1) + parallel (1.26.3) + parser (3.3.5.0) ast (~> 2.4.1) racc prettier_print (1.2.1) - racc (1.8.0) - rack (3.0.11) + racc (1.8.1) + rack (3.1.8) rainbow (3.1.1) regexp_parser (2.9.2) - rexml (3.3.6) - strscan - rubocop (1.64.0) + rubocop (1.67.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.31.1, < 2.0) + regexp_parser (>= 2.4, < 3.0) + rubocop-ast (>= 1.32.2, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.3) + rubocop-ast (1.32.3) parser (>= 3.3.1.0) - rubocop-capybara (2.20.0) + rubocop-capybara (2.21.0) rubocop (~> 1.41) - rubocop-discourse (3.8.0) + rubocop-discourse (3.8.2) activesupport (>= 6.1) rubocop (>= 1.59.0) rubocop-capybara (>= 2.0.0) rubocop-factory_bot (>= 2.0.0) rubocop-rails (>= 2.25.0) - rubocop-rspec (>= 2.25.0) - rubocop-factory_bot (2.25.1) - rubocop (~> 1.41) - rubocop-rails (2.25.0) + rubocop-rspec (>= 3.0.1) + rubocop-rspec_rails (>= 2.30.0) + rubocop-factory_bot (2.26.1) + rubocop (~> 1.61) + rubocop-rails (2.26.2) activesupport (>= 4.2.0) rack (>= 1.1) - rubocop (>= 1.33.0, < 2.0) + rubocop (>= 1.52.0, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) - rubocop-rspec (2.29.2) - rubocop (~> 1.40) - rubocop-capybara (~> 2.17) - rubocop-factory_bot (~> 2.22) - rubocop-rspec_rails (~> 2.28) - rubocop-rspec_rails (2.28.3) - rubocop (~> 1.40) + rubocop-rspec (3.1.0) + rubocop (~> 1.61) + rubocop-rspec_rails (2.30.0) + rubocop (~> 1.61) + rubocop-rspec (~> 3, >= 3.0.1) ruby-progressbar (1.13.0) - strscan (3.1.0) + securerandom (0.3.1) syntax_tree (6.2.0) prettier_print (>= 1.2.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.5.0) + unicode-display_width (2.6.0) PLATFORMS ruby diff --git a/LICENSE b/LICENSE index a71f6dee..8d90b864 100644 --- a/LICENSE +++ b/LICENSE @@ -1,20 +1,21 @@ The MIT License (MIT) -Copyright (c) 2014 Civilized Discourse Construction Kit, Inc. +Copyright (c) Civilized Discourse Construction Kit, Inc. -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/admin/assets/javascripts/discourse/components/docker-manager/console.gjs b/admin/assets/javascripts/discourse/components/docker-manager/console.gjs new file mode 100644 index 00000000..c8c3f1df --- /dev/null +++ b/admin/assets/javascripts/discourse/components/docker-manager/console.gjs @@ -0,0 +1,23 @@ +import Component from "@glimmer/component"; +import didInsert from "@ember/render-modifiers/modifiers/did-insert"; +import didUpdate from "@ember/render-modifiers/modifiers/did-update"; +import { bind } from "discourse-common/utils/decorators"; + +export default class Console extends Component { + @bind + scrollToBottom(element) { + if (this.args.followOutput) { + element.scrollTop = element.scrollHeight; + } + } + + +} diff --git a/admin/assets/javascripts/discourse/components/docker-manager/console.hbs b/admin/assets/javascripts/discourse/components/docker-manager/console.hbs deleted file mode 100644 index c0aafc53..00000000 --- a/admin/assets/javascripts/discourse/components/docker-manager/console.hbs +++ /dev/null @@ -1,7 +0,0 @@ -
- {{~@output~}} -
\ No newline at end of file diff --git a/admin/assets/javascripts/discourse/components/docker-manager/console.js b/admin/assets/javascripts/discourse/components/docker-manager/console.js deleted file mode 100644 index 964f9ffa..00000000 --- a/admin/assets/javascripts/discourse/components/docker-manager/console.js +++ /dev/null @@ -1,11 +0,0 @@ -import Component from "@glimmer/component"; -import { bind } from "discourse-common/utils/decorators"; - -export default class Console extends Component { - @bind - scrollToBottom(element) { - if (this.args.followOutput) { - element.scrollTop = element.scrollHeight; - } - } -} diff --git a/admin/assets/javascripts/discourse/components/docker-manager/progress-bar.js b/admin/assets/javascripts/discourse/components/docker-manager/progress-bar.gjs similarity index 61% rename from admin/assets/javascripts/discourse/components/docker-manager/progress-bar.js rename to admin/assets/javascripts/discourse/components/docker-manager/progress-bar.gjs index ecd8d0fc..25b22959 100644 --- a/admin/assets/javascripts/discourse/components/docker-manager/progress-bar.js +++ b/admin/assets/javascripts/discourse/components/docker-manager/progress-bar.gjs @@ -1,5 +1,6 @@ import Component from "@glimmer/component"; import { htmlSafe } from "@ember/template"; +import concatClass from "discourse/helpers/concat-class"; export default class ProgressBar extends Component { get active() { @@ -15,4 +16,10 @@ export default class ProgressBar extends Component { return htmlSafe(`width: ${percent}%`); } + + } diff --git a/admin/assets/javascripts/discourse/components/docker-manager/progress-bar.hbs b/admin/assets/javascripts/discourse/components/docker-manager/progress-bar.hbs deleted file mode 100644 index ca699321..00000000 --- a/admin/assets/javascripts/discourse/components/docker-manager/progress-bar.hbs +++ /dev/null @@ -1,3 +0,0 @@ -
-
-
\ No newline at end of file diff --git a/admin/assets/javascripts/discourse/components/docker-manager/upgrade-notice.gjs b/admin/assets/javascripts/discourse/components/docker-manager/upgrade-notice.gjs new file mode 100644 index 00000000..936f31f3 --- /dev/null +++ b/admin/assets/javascripts/discourse/components/docker-manager/upgrade-notice.gjs @@ -0,0 +1,22 @@ +import Component from "@glimmer/component"; +import { LinkTo } from "@ember/routing"; +import { service } from "@ember/service"; +import i18n from "discourse-common/helpers/i18n"; + +export default class UpgradeNotice extends Component { + @service currentUser; + + +} diff --git a/admin/assets/javascripts/discourse/components/docker-manager/upgrade-notice.hbs b/admin/assets/javascripts/discourse/components/docker-manager/upgrade-notice.hbs deleted file mode 100644 index 137d1487..00000000 --- a/admin/assets/javascripts/discourse/components/docker-manager/upgrade-notice.hbs +++ /dev/null @@ -1,11 +0,0 @@ -{{#if this.currentUser.admin}} - {{#unless @versionCheck.upToDate}} -
- {{i18n "admin.docker.outdated_notice"}} - - - {{i18n "admin.docker.perform_update"}} - -
- {{/unless}} -{{/if}} \ No newline at end of file diff --git a/admin/assets/javascripts/discourse/components/docker-manager/upgrade-notice.js b/admin/assets/javascripts/discourse/components/docker-manager/upgrade-notice.js deleted file mode 100644 index 0ed0e919..00000000 --- a/admin/assets/javascripts/discourse/components/docker-manager/upgrade-notice.js +++ /dev/null @@ -1,6 +0,0 @@ -import Component from "@glimmer/component"; -import { inject as service } from "@ember/service"; - -export default class UpgradeNotice extends Component { - @service currentUser; -} diff --git a/admin/assets/javascripts/discourse/components/repo-status.gjs b/admin/assets/javascripts/discourse/components/repo-status.gjs index 53c94fcf..ca268501 100644 --- a/admin/assets/javascripts/discourse/components/repo-status.gjs +++ b/admin/assets/javascripts/discourse/components/repo-status.gjs @@ -1,13 +1,12 @@ import Component from "@glimmer/component"; import { action } from "@ember/object"; -import { inject as service } from "@ember/service"; +import { service } from "@ember/service"; import DButton from "discourse/components/d-button"; -import FormatDate from "discourse/helpers/format-date"; +import formatDate from "discourse/helpers/format-date"; import icon from "discourse-common/helpers/d-icon"; import i18n from "discourse-common/helpers/i18n"; -import I18n from "I18n"; -import CommitUrl from "../helpers/commit-url"; -import NewCommits from "../helpers/new-commits"; +import commitUrl from "../helpers/commit-url"; +import newCommits from "../helpers/new-commits"; export default class RepoStatus extends Component { @service router; @@ -33,9 +32,9 @@ export default class RepoStatus extends Component { get upgradeButtonLabel() { if (this.args.repo.upgrading) { - return I18n.t("admin.docker.updating"); + return i18n("admin.docker.updating"); } else { - return I18n.t("admin.docker.update_action"); + return i18n("admin.docker.update_action"); } } @@ -52,14 +51,17 @@ export default class RepoStatus extends Component {
{{@repo.nameTitleized}}
+ {{#if @repo.author}}
{{@repo.author}}
{{/if}} + {{#if @repo.plugin}}
{{@repo.plugin.about}} + {{#if @repo.linkUrl}} {{/if}} + {{#if @repo.hasNewVersion}}
{{i18n "admin.docker.new_version_available"}} @@ -83,14 +86,14 @@ export default class RepoStatus extends Component {
{{i18n "admin.docker.repo.commit_hash"}}
- {{CommitUrl "current" @repo.version @repo.prettyVersion @repo.url}} + {{commitUrl "current" @repo.version @repo.prettyVersion @repo.url}}
{{i18n "admin.docker.repo.last_updated"}}
- {{FormatDate @repo.latest.date leaveAgo="true"}} + {{formatDate @repo.latest.date leaveAgo="true"}} @@ -99,7 +102,7 @@ export default class RepoStatus extends Component {
- {{CommitUrl + {{commitUrl "new" @repo.latest.version @repo.prettyLatestVersion @@ -107,7 +110,7 @@ export default class RepoStatus extends Component { }}
- {{NewCommits + {{newCommits @repo.latest.commits_behind @repo.version @repo.latest.version diff --git a/admin/assets/javascripts/discourse/controllers/update-index.js b/admin/assets/javascripts/discourse/controllers/update-index.js index 99437c53..2e21177a 100644 --- a/admin/assets/javascripts/discourse/controllers/update-index.js +++ b/admin/assets/javascripts/discourse/controllers/update-index.js @@ -1,7 +1,7 @@ import { cached } from "@glimmer/tracking"; import Controller from "@ember/controller"; import { action } from "@ember/object"; -import { inject as service } from "@ember/service"; +import { service } from "@ember/service"; import { needsImageUpgrade } from "../models/repo"; export default class UpgradeIndex extends Controller { diff --git a/admin/assets/javascripts/discourse/controllers/update-show.js b/admin/assets/javascripts/discourse/controllers/update-show.js index d0e1b813..b55c0462 100644 --- a/admin/assets/javascripts/discourse/controllers/update-show.js +++ b/admin/assets/javascripts/discourse/controllers/update-show.js @@ -1,12 +1,11 @@ import Controller from "@ember/controller"; import { action } from "@ember/object"; -import { inject as service } from "@ember/service"; +import { service } from "@ember/service"; import { makeArray } from "discourse-common/lib/helpers"; -import I18n from "I18n"; +import I18n from "discourse-i18n"; import Repo from "../models/repo"; export default class UpgradeShow extends Controller { - @service messageBus; @service dialog; @service upgradeStore; diff --git a/admin/assets/javascripts/discourse/controllers/update.js b/admin/assets/javascripts/discourse/controllers/update.js index 19c21c31..047979bc 100644 --- a/admin/assets/javascripts/discourse/controllers/update.js +++ b/admin/assets/javascripts/discourse/controllers/update.js @@ -4,8 +4,8 @@ import { action } from "@ember/object"; import { TrackedArray } from "@ember-compat/tracked-built-ins"; export default class Upgrade extends Controller { - @tracked banner = new TrackedArray([]); @tracked bannerDismissed = false; + banner = new TrackedArray(); get showBanner() { if (this.bannerDismissed) { diff --git a/admin/assets/javascripts/discourse/helpers/commit-url.js b/admin/assets/javascripts/discourse/helpers/commit-url.js index 802e213c..5cb06496 100644 --- a/admin/assets/javascripts/discourse/helpers/commit-url.js +++ b/admin/assets/javascripts/discourse/helpers/commit-url.js @@ -10,7 +10,7 @@ export default function commitUrl(cssClass, version, prettyVersion, url) { } const repoUrl = url.substr(0, url.search(/(\.git)?$/)); - const description = `${prettyVersion}`; - - return new htmlSafe(description); + return htmlSafe( + `${prettyVersion}` + ); } diff --git a/admin/assets/javascripts/discourse/helpers/new-commits.js b/admin/assets/javascripts/discourse/helpers/new-commits.js index cdd944d8..a62e2201 100644 --- a/admin/assets/javascripts/discourse/helpers/new-commits.js +++ b/admin/assets/javascripts/discourse/helpers/new-commits.js @@ -1,10 +1,7 @@ -import { helper as buildHelper } from "@ember/component/helper"; import { htmlSafe } from "@ember/template"; -import I18n from "I18n"; - -export default buildHelper(function (params) { - const [commitsBehind, oldSha, newSha, url] = params; +import I18n from "discourse-i18n"; +export default function newCommits(commitsBehind, oldSha, newSha, url) { if (!commitsBehind) { return ""; } @@ -13,7 +10,7 @@ export default buildHelper(function (params) { return ""; } - let description = I18n.t("admin.docker.commits", { + const description = I18n.t("admin.docker.commits", { count: commitsBehind, }); @@ -22,7 +19,7 @@ export default buildHelper(function (params) { } const _url = url.substr(0, url.search(/(\.git)?$/)); - description = `${description}`; - - return new htmlSafe(description); -}); + return htmlSafe( + `${description}` + ); +} diff --git a/admin/assets/javascripts/discourse/routes/update-show.js b/admin/assets/javascripts/discourse/routes/update-show.js index a808069a..b515ccf1 100644 --- a/admin/assets/javascripts/discourse/routes/update-show.js +++ b/admin/assets/javascripts/discourse/routes/update-show.js @@ -1,5 +1,5 @@ import Route from "@ember/routing/route"; -import { inject as service } from "@ember/service"; +import { service } from "@ember/service"; import Repo from "../models/repo"; export default class UpgradeShow extends Route { diff --git a/admin/assets/javascripts/discourse/routes/update.js b/admin/assets/javascripts/discourse/routes/update.js index 008f5201..cd6c716b 100644 --- a/admin/assets/javascripts/discourse/routes/update.js +++ b/admin/assets/javascripts/discourse/routes/update.js @@ -1,7 +1,7 @@ import Route from "@ember/routing/route"; -import { inject as service } from "@ember/service"; +import { service } from "@ember/service"; import { bind } from "discourse-common/utils/decorators"; -import I18n from "I18n"; +import I18n from "discourse-i18n"; import Repo from "../models/repo"; export default class Upgrade extends Route { diff --git a/admin/assets/javascripts/discourse/templates/update-processes.hbs b/admin/assets/javascripts/discourse/templates/update-processes.hbs index 52f62091..356d78fc 100644 --- a/admin/assets/javascripts/discourse/templates/update-processes.hbs +++ b/admin/assets/javascripts/discourse/templates/update-processes.hbs @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/lib/docker_manager/fallback_compatibility_parser.rb b/lib/docker_manager/fallback_compatibility_parser.rb index 656c6605..7d0d0658 100644 --- a/lib/docker_manager/fallback_compatibility_parser.rb +++ b/lib/docker_manager/fallback_compatibility_parser.rb @@ -9,7 +9,7 @@ def self.find_compatible_resource(version_list, target_version = ::Discourse::VE begin version_list = YAML.safe_load(version_list) - rescue Psych::SyntaxError, Psych::DisallowedClass => e + rescue Psych::SyntaxError, Psych::DisallowedClass end raise Discourse::InvalidVersionListError unless version_list.is_a?(Hash) @@ -18,7 +18,7 @@ def self.find_compatible_resource(version_list, target_version = ::Discourse::VE version_list .transform_keys do |v| Gem::Requirement.parse(v) - rescue Gem::Requirement::BadRequirementError => e + rescue Gem::Requirement::BadRequirementError raise Discourse::InvalidVersionListError, "Invalid version specifier: #{v}" end .sort_by do |parsed_requirement, _| @@ -61,12 +61,12 @@ def self.find_compatible_resource(version_list, target_version = ::Discourse::VE # Find a compatible resource from a git repo def self.find_compatible_git_resource(path) return unless File.directory?("#{path}/.git") - compat_resource, std_error, s = + compat_resource, _, s = Open3.capture3( "git -C '#{path}' show HEAD@{upstream}:#{Discourse::VERSION_COMPATIBILITY_FILENAME}", ) self.find_compatible_resource(compat_resource) if s.success? - rescue Discourse::InvalidVersionListError => e + rescue Discourse::InvalidVersionListError $stderr.puts "Invalid version list in #{path}" end end diff --git a/lib/docker_manager/git_repo.rb b/lib/docker_manager/git_repo.rb index ed7724fe..30e00a3c 100644 --- a/lib/docker_manager/git_repo.rb +++ b/lib/docker_manager/git_repo.rb @@ -178,7 +178,7 @@ def tracking_tag def run(cmd) @memoize[cmd] ||= begin - stdout, stderr, status = Open3.capture3("git #{cmd}", chdir: path) + stdout, _, status = Open3.capture3("git #{cmd}", chdir: path) status == 0 ? stdout.strip : nil end rescue => e diff --git a/package.json b/package.json index a4caa0b0..1872fa5e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "devDependencies": { - "@discourse/lint-configs": "1.3.10", + "@discourse/lint-configs": "1.4.2", "ember-template-lint": "6.0.0", "eslint": "8.57.1", "prettier": "2.8.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 20857d47..a4213492 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,8 +12,8 @@ importers: specifier: ^7.25.7 version: 7.25.7(@babel/core@7.25.8) '@discourse/lint-configs': - specifier: 1.3.10 - version: 1.3.10(ember-template-lint@6.0.0)(eslint@8.57.1)(prettier@2.8.8) + specifier: 1.4.2 + version: 1.4.2(ember-template-lint@6.0.0)(eslint@8.57.1)(prettier@2.8.8) ember-template-lint: specifier: 6.0.0 version: 6.0.0 @@ -152,11 +152,11 @@ packages: resolution: {integrity: sha512-JWtuCu8VQsMladxVz/P4HzHUGCAwpuqacmowgXFs5XjxIgKuNjnLokQzuVjlTvIzODaDmpjT3oxcC48vyk9EWg==} engines: {node: '>=6.9.0'} - '@discourse/lint-configs@1.3.10': - resolution: {integrity: sha512-PQ56xx4UfceLR/wJm7ig1JRNKkLVYPAeyp5bV6k6jQhpVr9TeZdobeCfGbVtKG6hhuaQ4aECPjRf/MoNw00/cw==} + '@discourse/lint-configs@1.4.2': + resolution: {integrity: sha512-AhwEfqy7ByheuNEhioXlkcgrbvzQY8yFbSWwtqAB0GXsp4UNaMZFyjdMoPFgaUDdUzjY/eKFFZ/j4FkA9EY4qA==} peerDependencies: ember-template-lint: 6.0.0 - eslint: 8.57.0 + eslint: 8.57.1 prettier: 2.8.8 '@ember-data/rfc395-data@0.0.4': @@ -1947,7 +1947,7 @@ snapshots: '@babel/helper-validator-identifier': 7.25.7 to-fast-properties: 2.0.0 - '@discourse/lint-configs@1.3.10(ember-template-lint@6.0.0)(eslint@8.57.1)(prettier@2.8.8)': + '@discourse/lint-configs@1.4.2(ember-template-lint@6.0.0)(eslint@8.57.1)(prettier@2.8.8)': dependencies: '@babel/core': 7.25.8 '@babel/eslint-parser': 7.25.8(@babel/core@7.25.8)(eslint@8.57.1) diff --git a/spec/support/git_helpers.rb b/spec/support/git_helpers.rb index 26e6fac0..f2f5d69d 100644 --- a/spec/support/git_helpers.rb +++ b/spec/support/git_helpers.rb @@ -195,7 +195,7 @@ def initialize(path, clone_method) def git(*commands) Dir.chdir(@path) do commands.map do |command| - stdout, stderr, status = Open3.capture3("git #{command}".strip) + stdout, _, status = Open3.capture3("git #{command}".strip) status.success? ? stdout : (raise RuntimeError) end end diff --git a/spec/system/admin_update_spec.rb b/spec/system/admin_update_spec.rb index 2b759dd1..c9775367 100644 --- a/spec/system/admin_update_spec.rb +++ b/spec/system/admin_update_spec.rb @@ -8,7 +8,7 @@ before { sign_in(admin) } - xit "displays the admin update page with the right respositories" do + xit "displays the admin update page with the right repositories" do visit("/admin/update") expect(page).to have_css("h3", exact_text: I18n.t("js.admin.docker.update_title")) diff --git a/test/javascripts/integration/components/repo-status-test.js b/test/javascripts/integration/components/repo-status-test.js index c4e957a7..5e20cc27 100644 --- a/test/javascripts/integration/components/repo-status-test.js +++ b/test/javascripts/integration/components/repo-status-test.js @@ -1,9 +1,8 @@ -import { getOwner } from "@ember/application"; +import { getOwner } from "@ember/owner"; import { render, settled } from "@ember/test-helpers"; import { setupRenderingTest } from "ember-qunit"; import hbs from "htmlbars-inline-precompile"; import { module, test } from "qunit"; -import { query } from "discourse/tests/helpers/qunit-helpers"; const repoProps = { unloaded: false, @@ -46,7 +45,7 @@ const managerProps = { module("Integration | Component | RepoStatus", function (hooks) { setupRenderingTest(hooks); - test("it renders correctly", async function (assert) { + test("renders correctly", async function (assert) { const store = getOwner(this).lookup("service:store"); this.set("repo", store.createRecord("repo", repoProps)); this.set("managerRepo", store.createRecord("repo", managerProps)); @@ -65,26 +64,24 @@ module("Integration | Component | RepoStatus", function (hooks) { assert .dom("div.new-commits a") .hasText("3 new commits", "shows number of new commits"); - assert.strictEqual( - query("div.new-commits a").href.trim(), - "https://github.com/discourse/discourse/compare/8f65e4f...2b006c0", - "links to GitHub diff page" - ); + assert + .dom("div.new-commits a") + .hasAttribute( + "href", + "https://github.com/discourse/discourse/compare/8f65e4f...2b006c0", + "links to GitHub diff page" + ); this.repo.pretty_version = null; this.repo.latest.pretty_version = null; await settled(); - assert.strictEqual( - query("a.current.commit-hash").textContent.trim(), - "8f65e4f", - "commit hash is used when tag version is absent" - ); - assert.strictEqual( - query("a.new.commit-hash").textContent.trim(), - "2b006c0", - "commit hash is used when tag version is absent" - ); + assert + .dom("a.current.commit-hash") + .hasText("8f65e4f", "commit hash is used when tag version is absent"); + assert + .dom("a.new.commit-hash") + .hasText("2b006c0", "commit hash is used when tag version is absent"); }); test("official plugin", async function (assert) { @@ -97,11 +94,9 @@ module("Integration | Component | RepoStatus", function (hooks) { hbs`` ); - assert.strictEqual( - query("div.d-admin-row__overview-author").textContent.trim(), - "By Discourse", - "shows plugin author" - ); + assert + .dom("div.d-admin-row__overview-author") + .hasText("By Discourse", "shows plugin author"); }); test("update button", async function (assert) {