ui: Upgrade to ember 3.16 Octane Edition (#7334)

* v3.12.0...v3.16.0

* Upgrades

* Remove old wormhole fix

* Fixup ember power select (camelcasing)

* Fixup immedaitely closing dropdown

When clicking on the syntax selector, it seemed like an extra click
event was firing from the label, which then immediately closed the
dropdown. By adding a for="" attribute this event isn't passed to the
dropdown menu and therefore doesn't immediately close

* Fix up integration tests with new style (plus standardize titles)

* Temporarily disable some template linting rules

* Add required methods (even though they aren't used anywhere)

* Ensure event sources get closed on destruction
This commit is contained in:
John Cowen 2020-02-21 16:48:54 +00:00 committed by John Cowen
parent 397757ae62
commit 2f28232df0
42 changed files with 1774 additions and 921 deletions

View File

@ -4,7 +4,6 @@
root = true
[*]
end_of_line = lf
charset = utf-8

View File

@ -1,8 +1,12 @@
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module'
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true
}
},
plugins: ['ember'],
extends: ['eslint:recommended', 'plugin:ember/recommended'],
@ -11,7 +15,8 @@ module.exports = {
},
rules: {
'no-unused-vars': ['error', { args: 'none' }],
'ember/no-new-mixins': ['warn']
'ember/no-new-mixins': ['warn'],
'ember/no-jquery': 'warn'
},
overrides: [
// node files

View File

@ -1,7 +1,7 @@
'use strict';
module.exports = {
extends: 'recommended',
extends: 'octane',
rules: {
'no-partial': false,
@ -10,6 +10,7 @@ module.exports = {
'self-closing-void-elements': false,
'no-unnecessary-concat': false,
'no-quoteless-attributes': false,
'no-nested-interactive': false,
'block-indentation': false,
@ -19,6 +20,15 @@ module.exports = {
'no-triple-curlies': false,
'no-unused-block-params': false,
'style-concatenation': false,
'link-rel-noopener': false
'link-rel-noopener': false,
'no-implicit-this': false,
'no-curly-component-invocation': false,
'no-action': false,
'no-negated-condition': false,
'no-invalid-role': false,
'no-unnecessary-component-helper': false,
'link-href-attributes': false
},
};

27
ui-v2/.travis.yml Normal file
View File

@ -0,0 +1,27 @@
---
language: node_js
node_js:
- "10"
dist: trusty
addons:
chrome: stable
cache:
directories:
- $HOME/.npm
env:
global:
# See https://git.io/vdao3 for details.
- JOBS=1
branches:
only:
- master
script:
- npm run lint:hbs
- npm run lint:js
- npm test

View File

@ -1,14 +1,12 @@
import Application from '@ember/application';
import Resolver from './resolver';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';
const App = Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver,
});
export default class App extends Application {
modulePrefix = config.modulePrefix;
podModulePrefix = config.podModulePrefix;
Resolver = Resolver;
}
loadInitializers(App, config.modulePrefix);
export default App;

View File

@ -53,6 +53,10 @@ export default Mixin.create(WithListeners, {
}
return this._super(...arguments);
},
willDestroy: function() {
this._super(...arguments);
this.reset(true);
},
});
export const listen = purify(catchable, function(props) {
return props.map(item => `${PREFIX}${item}`);

View File

@ -1,3 +0,0 @@
import Resolver from 'ember-resolver';
export default Resolver;

View File

@ -2,10 +2,6 @@ import EmberRouter from '@ember/routing/router';
import { env } from 'consul-ui/env';
import walk from 'consul-ui/utils/routing/walk';
const Router = EmberRouter.extend({
location: env('locationType'),
rootURL: env('rootURL'),
});
export const routes = {
// Our parent datacenter resource sets the namespace
// for the entire application
@ -122,4 +118,9 @@ if (env('CONSUL_NSPACES_ENABLED')) {
dc: routes.dc,
};
}
export default Router.map(walk(routes));
export default class Router extends EmberRouter {
location = env('locationType');
rootURL = env('rootURL');
}
Router.map(walk(routes));

View File

@ -1,7 +1,14 @@
import RepositoryService from 'consul-ui/services/repository';
import { PRIMARY_KEY, SLUG_KEY } from 'consul-ui/models/nspace';
const modelName = 'nspace';
export default RepositoryService.extend({
getPrimaryKey: function() {
return PRIMARY_KEY;
},
getSlugKey: function() {
return SLUG_KEY;
},
getModelName: function() {
return modelName;
},

View File

@ -1,9 +1,16 @@
import RepositoryService from 'consul-ui/services/repository';
import { Promise } from 'rsvp';
import { PRIMARY_KEY, SLUG_KEY } from 'consul-ui/models/nspace';
const modelName = 'nspace';
const DEFAULT_NSPACE = 'default';
export default RepositoryService.extend({
getPrimaryKey: function() {
return PRIMARY_KEY;
},
getSlugKey: function() {
return SLUG_KEY;
},
getModelName: function() {
return modelName;
},

View File

@ -2,11 +2,18 @@ import { inject as service } from '@ember/service';
import { get } from '@ember/object';
import { env } from 'consul-ui/env';
import RepositoryService from 'consul-ui/services/repository';
import { PRIMARY_KEY, SLUG_KEY } from 'consul-ui/models/nspace';
const modelName = 'nspace';
export default RepositoryService.extend({
router: service('router'),
settings: service('settings'),
getPrimaryKey: function() {
return PRIMARY_KEY;
},
getSlugKey: function() {
return SLUG_KEY;
},
getModelName: function() {
return modelName;
},

View File

@ -6,10 +6,6 @@
/*TODO: Move this to its own local component*/
@import 'ember-power-select';
#ember-basic-dropdown-wormhole {
z-index: 510;
position: relative;
}
/**/
@import 'components/index';

View File

@ -2,7 +2,14 @@
<YieldSlot @name="create">{{yield}}</YieldSlot>
<label class="type-text">
<span><YieldSlot @name="label">{{yield}}</YieldSlot></span>
<PowerSelect @onopen={{action "open"}} @search={{action "search"}} @options={{options}} @loadingMessage="Loading..." @searchMessage="No possible options" @searchPlaceholder={{placeholder}} @onchange={{action "change" "items[]" items}} as |item|>
<PowerSelect
@search={{action "search"}}
@options={{options}}
@loadingMessage="Loading..."
@searchMessage="No possible options"
@searchPlaceholder={{placeholder}}
@onOpen={{action "open"}}
@onChange={{action "change" "items[]" items}} as |item|>
<YieldSlot @name="option" @params={{block-params item}}>{{yield}}</YieldSlot>
</PowerSelect>
</label>

View File

@ -1,7 +1,11 @@
<IvyCodemirror @value={{value}} @name={{name}} @class={{class}} @options={{options}} @valueUpdated={{action onkeyup}} />
<pre><code>{{yield}}</code></pre>
{{#if (and (not readonly) (not syntax))}}
<PowerSelect @onchange={{action "change"}} @selected={{mode}} @searchEnabled={{false}} @options={{modes}} as |mode|>
<PowerSelect
@onChange={{action "change"}}
@selected={{mode}}
@searchEnabled={{false}}
@options={{modes}} as |mode|>
{{mode.name}}
</PowerSelect>
{{/if}}

View File

@ -5,24 +5,40 @@
<h2>Source</h2>
<label data-test-source-element class="type-text{{if item.error.SourceName ' has-error'}}">
<span>Source Service</span>
<PowerSelectWithCreate @options={{services}} @searchField="Name" @selected={{SourceName}} @searchPlaceholder="Type service name" @buildSuggestion={{action "createNewLabel" "Use a future Consul Service called '{{term}}'"}} @showCreateWhen={{action "isUnique"}} @oncreate={{action "change" "SourceName"}} @onchange={{action "change" "SourceName"}} as |service|>
{{#if (eq service.Name '*') }}
* (All Services)
{{else}}
{{service.Name}}
{{/if}}
<PowerSelectWithCreate
@options={{services}}
@searchField="Name"
@selected={{SourceName}}
@searchPlaceholder="Type service name"
@buildSuggestion={{action "createNewLabel" "Use a future Consul Service called '{{term}}'"}}
@showCreateWhen={{action "isUnique"}}
@onCreate={{action "change" "SourceName"}}
@onChange={{action "change" "SourceName"}} as |service|>
{{#if (eq service.Name '*') }}
* (All Services)
{{else}}
{{service.Name}}
{{/if}}
</PowerSelectWithCreate>
<em>Search for an existing service, write in a future one, or write in any Service URI.</em>
</label>
{{#if (env 'CONSUL_NSPACES_ENABLED')}}
<label data-test-source-nspace class="type-text{{if item.error.SourceNS ' has-error'}}">
<span>Source Namespace</span>
<PowerSelectWithCreate @options={{nspaces}} @searchField="Name" @selected={{SourceNS}} @searchPlaceholder="Type namespace name" @buildSuggestion={{action "createNewLabel" "Use a future Consul Namespace called '{{term}}'"}} @showCreateWhen={{action "isUnique"}} @oncreate={{action "change" "SourceNS"}} @onchange={{action "change" "SourceNS"}} as |nspace|>
{{#if (eq nspace.Name '*') }}
* (All Namespaces)
{{else}}
{{nspace.Name}}
{{/if}}
<PowerSelectWithCreate
@options={{nspaces}}
@searchField="Name"
@selected={{SourceNS}}
@searchPlaceholder="Type namespace name"
@buildSuggestion={{action "createNewLabel" "Use a future Consul Namespace called '{{term}}'"}}
@showCreateWhen={{action "isUnique"}}
@onCreate={{action "change" "SourceNS"}}
@onChange={{action "change" "SourceNS"}} as |nspace|>
{{#if (eq nspace.Name '*') }}
* (All Namespaces)
{{else}}
{{nspace.Name}}
{{/if}}
</PowerSelectWithCreate>
<em>Search for an existing namespace, write in a future one.</em>
</label>
@ -32,24 +48,40 @@
<h2>Destination</h2>
<label data-test-destination-element class="type-text{{if item.error.DestinationName ' has-error'}}">
<span>Destination Service</span>
<PowerSelectWithCreate @options={{services}} @searchField="Name" @selected={{DestinationName}} @searchPlaceholder="Type service name" @buildSuggestion={{action "createNewLabel" "Use a future Consul Service called '{{term}}'"}} @showCreateWhen={{action "isUnique"}} @oncreate={{action "change" "DestinationName"}} @onchange={{action "change" "DestinationName"}} as |service|>
{{#if (eq service.Name '*') }}
* (All Services)
{{else}}
{{service.Name}}
{{/if}}
<PowerSelectWithCreate
@options={{services}}
@searchField="Name"
@selected={{DestinationName}}
@searchPlaceholder="Type service name"
@buildSuggestion={{action "createNewLabel" "Use a future Consul Service called '{{term}}'"}}
@showCreateWhen={{action "isUnique"}}
@onCreate={{action "change" "DestinationName"}}
@onChange={{action "change" "DestinationName"}} as |service|>
{{#if (eq service.Name '*') }}
* (All Services)
{{else}}
{{service.Name}}
{{/if}}
</PowerSelectWithCreate>
<em>Search for an existing service or write in a future one.</em>
</label>
{{#if (env 'CONSUL_NSPACES_ENABLED')}}
<label data-test-destination-nspace class="type-text{{if item.error.DestinationNS ' has-error'}}">
<span>Destination Namespace</span>
<PowerSelectWithCreate @options={{nspaces}} @searchField="Name" @selected={{DestinationNS}} @searchPlaceholder="Type namespace name" @buildSuggestion={{action "createNewLabel" "Use a future Consul Namespace called '{{term}}'"}} @showCreateWhen={{action "isUnique"}} @oncreate={{action "change" "DestinationNS"}} @onchange={{action "change" "DestinationNS"}} as |nspace|>
{{#if (eq nspace.Name '*') }}
* (All Namespaces)
{{else}}
{{nspace.Name}}
{{/if}}
<PowerSelectWithCreate
@options={{nspaces}}
@searchField="Name"
@selected={{DestinationNS}}
@searchPlaceholder="Type namespace name"
@buildSuggestion={{action "createNewLabel" "Use a future Consul Namespace called '{{term}}'"}}
@showCreateWhen={{action "isUnique"}}
@onCreate={{action "change" "DestinationNS"}}
@onChange={{action "change" "DestinationNS"}} as |nspace|>
{{#if (eq nspace.Name '*') }}
* (All Namespaces)
{{else}}
{{nspace.Name}}
{{/if}}
</PowerSelectWithCreate>
<em>For the destination, you may choose any namespace for which you have access.</em>
</label>

View File

@ -15,7 +15,7 @@
<span>Code</span>
</label>
</div>
<label class="type-text{{if item.error.Value ' has-error'}}">
<label for="" class="type-text{{if item.error.Value ' has-error'}}">
<span>Value</span>
{{#if json}}
<CodeEditor @value={{atob item.Value}} @onkeyup={{action "change" "value"}} />

View File

@ -51,6 +51,8 @@ export default function(ObjProxy, ArrProxy, createListeners) {
return this._source.open(...arguments);
},
willDestroy: function() {
this._super(...arguments);
this.close();
this.listeners.remove();
},
});

View File

@ -1,3 +1,6 @@
{
"jquery-integration": true
"application-template-wrapper": false,
"default-async-observers": true,
"jquery-integration": false,
"template-only-glimmer-components": true
}

View File

@ -9,7 +9,7 @@
"test": "tests"
},
"scripts": {
"build": "ember build --environment production",
"build": "ember build --environment=production",
"build:staging": "ember build --environment staging",
"build:ci": "ember build --environment test",
"lint:dev:js": "eslint -c .dev.eslintrc.js --fix ./*.js ./.*.js app config lib server tests",
@ -52,58 +52,61 @@
"devDependencies": {
"@babel/core": "^7.2.2",
"@babel/plugin-proposal-object-rest-spread": "^7.5.5",
"@ember/jquery": "^0.6.0",
"@ember/optional-features": "^0.7.0",
"@ember/jquery": "^1.1.0",
"@ember/optional-features": "^1.3.0",
"@glimmer/component": "^1.0.0",
"@glimmer/tracking": "^1.0.0",
"@hashicorp/consul-api-double": "^2.6.2",
"@hashicorp/ember-cli-api-double": "^3.0.2",
"babel-eslint": "^10.0.3",
"base64-js": "^1.3.0",
"broccoli-asset-rev": "^3.0.0",
"chalk": "^2.4.2",
"clipboard": "^2.0.4",
"css.escape": "^1.5.1",
"dart-sass": "^1.25.0",
"ember-auto-import": "^1.4.0",
"ember-changeset-validations": "^2.1.0",
"ember-cli": "~3.12.0",
"ember-auto-import": "^1.5.3",
"ember-changeset-validations": "^3.0.2",
"ember-cli": "~3.16.0",
"ember-cli-app-version": "^3.2.0",
"ember-cli-autoprefixer": "^0.8.1",
"ember-cli-babel": "^7.7.3",
"ember-cli-babel": "^7.17.2",
"ember-cli-code-coverage": "^1.0.0-beta.4",
"ember-cli-dependency-checker": "^3.1.0",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-eslint": "^5.1.0",
"ember-cli-flash": "^1.6.3",
"ember-cli-htmlbars": "^3.0.1",
"ember-cli-htmlbars-inline-precompile": "^3.0.0",
"ember-cli-inject-live-reload": "^2.0.1",
"ember-cli-page-object": "^1.15.0-beta.2",
"ember-cli-htmlbars": "^4.2.2",
"ember-cli-inject-live-reload": "^2.0.2",
"ember-cli-page-object": "^1.16.2",
"ember-cli-sass": "^10.0.1",
"ember-cli-sri": "^2.1.1",
"ember-cli-string-helpers": "^4.0.3",
"ember-cli-template-lint": "^1.0.0-beta.1",
"ember-cli-template-lint": "^2.0.1",
"ember-cli-uglify": "^3.0.0",
"ember-cli-yadda": "^0.5.0",
"ember-collection": "^1.0.0-alpha.9",
"ember-composable-helpers": "^2.1.0",
"ember-composable-helpers": "^3.1.1",
"ember-computed-style": "^0.3.0",
"ember-data": "~3.12.0",
"ember-data": "~3.16.0",
"ember-exam": "^4.0.0",
"ember-export-application-global": "^2.0.0",
"ember-export-application-global": "^2.0.1",
"ember-fetch": "^7.0.0",
"ember-href-to": "^3.1.0",
"ember-inflector": "^3.0.0",
"ember-load-initializers": "^2.0.0",
"ember-load-initializers": "^2.1.1",
"ember-math-helpers": "^2.4.0",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-page-title": "^5.1.0",
"ember-power-select": "^3.0.3",
"ember-power-select-with-create": "^0.6.0",
"ember-qunit": "^4.4.1",
"ember-resolver": "^5.0.1",
"ember-sinon-qunit": "^3.4.0",
"ember-source": "~3.12.0",
"ember-test-selectors": "^2.1.0",
"ember-power-select": "^3.0.6",
"ember-power-select-with-create": "^0.7.0",
"ember-qunit": "^4.6.0",
"ember-resolver": "^7.0.0",
"ember-sinon-qunit": "4.0.1",
"ember-source": "~3.16.0",
"ember-test-selectors": "^4.0.0",
"ember-truth-helpers": "^2.0.0",
"eslint-plugin-ember": "^7.0.0",
"eslint-plugin-node": "^10.0.0",
"eslint-plugin-ember": "^7.7.2",
"eslint-plugin-node": "^11.0.0",
"flat": "^4.1.0",
"husky": "^3.0.5",
"ivy-codemirror": "^2.1.0",
@ -115,12 +118,15 @@
"node-sass": "^4.9.3",
"pretender": "^3.2.0",
"prettier": "^1.10.2",
"qunit-dom": "^0.9.0",
"qunit-dom": "^1.0.0",
"tape": "^4.13.0",
"text-encoding": "^0.7.0"
},
"engines": {
"node": "8.* || >= 10.*"
"node": "10.* || >= 12"
},
"ember": {
"edition": "octane"
},
"ember-addon": {
"paths": [

View File

@ -1,8 +1,13 @@
module.exports = {
test_page: 'tests/index.html?hidepassed',
disable_watching: true,
launch_in_ci: ['Chrome'],
launch_in_dev: ['Chrome'],
launch_in_ci: [
'Chrome'
],
launch_in_dev: [
'Chrome'
],
browser_start_timeout: 120,
browser_args: {
Chrome: {
ci: [

View File

@ -12,14 +12,13 @@ module('Integration | Component | changeable set', function(hooks) {
await render(hbs`{{changeable-set}}`);
assert.dom('*').hasText('');
assert.equal(this.element.textContent.trim(), '');
// Template block usage:
await render(hbs`
{{#changeable-set}}
{{/changeable-set}}
`);
assert.dom('*').hasText('');
assert.equal(this.element.textContent.trim(), '');
});
});

View File

@ -1,6 +1,6 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, find } from '@ember/test-helpers';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
module('Integration | Component | service identity', function(hooks) {
@ -12,23 +12,13 @@ module('Integration | Component | service identity', function(hooks) {
await render(hbs`{{service-identity}}`);
assert.ok(
find('*')
.textContent.trim()
.indexOf('service_prefix') !== -1,
''
);
assert.ok(this.element.textContent.trim().indexOf('service_prefix') !== -1);
// Template block usage:
await render(hbs`
{{#service-identity}}{{/service-identity}}
`);
assert.ok(
find('*')
.textContent.trim()
.indexOf('service_prefix') !== -1,
''
);
assert.ok(this.element.textContent.trim().indexOf('service_prefix') !== -1);
});
});

View File

@ -12,7 +12,7 @@ module('Integration | Component | token list', function(hooks) {
await render(hbs`{{token-list}}`);
assert.dom('*').hasText('');
assert.equal(this.element.textContent.trim(), '');
// Template block usage:
await render(hbs`
@ -20,6 +20,6 @@ module('Integration | Component | token list', function(hooks) {
{{/token-list}}
`);
assert.dom('*').hasText('');
assert.equal(this.element.textContent.trim(), '');
});
});

View File

@ -3,7 +3,7 @@ import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
module('helper:atob', function(hooks) {
module('Integration | Helper | atob', function(hooks) {
setupRenderingTest(hooks);
// Replace this with your real tests.
@ -11,6 +11,6 @@ module('helper:atob', function(hooks) {
this.set('inputValue', 'MTIzNA==');
await render(hbs`{{atob inputValue}}`);
assert.dom('*').hasText('1234');
assert.equal(this.element.textContent.trim(), '1234');
});
});

View File

@ -3,7 +3,7 @@ import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
module('helper:default', function(hooks) {
module('Integration | Helper | default', function(hooks) {
setupRenderingTest(hooks);
// Replace this with your real tests.
@ -12,13 +12,13 @@ module('helper:default', function(hooks) {
await render(hbs`{{default inputValue}}`);
assert.dom('*').hasText('1234');
assert.equal(this.element.textContent.trim(), '1234');
});
test('it renders the default value', async function(assert) {
this.set('inputValue', '');
await render(hbs`{{default inputValue '1234'}}`);
assert.dom('*').hasText('1234');
assert.equal(this.element.textContent.trim(), '1234');
});
});

View File

@ -3,7 +3,7 @@ import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
module('helper:env', function(hooks) {
module('Integration | Helper | env', function(hooks) {
setupRenderingTest(hooks);
// Replace this with your real tests.
@ -12,6 +12,6 @@ module('helper:env', function(hooks) {
await render(hbs`{{env inputValue}}`);
assert.dom('*').hasText('https://www.hashicorp.com');
assert.equal(this.element.textContent.trim(), 'https://www.hashicorp.com');
});
});

View File

@ -3,7 +3,7 @@ import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
module('helper:format-number', function(hooks) {
module('Integration | Helper | format-number', function(hooks) {
setupRenderingTest(hooks);
test('it renders a formatted number when passed a number', async function(assert) {
@ -11,6 +11,6 @@ module('helper:format-number', function(hooks) {
await render(hbs`{{format-number inputValue}}`);
assert.dom('*').hasText('1,234');
assert.equal(this.element.textContent.trim(), '1,234');
});
});

View File

@ -2,7 +2,7 @@ import { module, skip } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
module('helper:is-href', function(hooks) {
module('Integration | Helper | is-href', function(hooks) {
setupRenderingTest(hooks);
// Replace this with your real tests.
@ -11,6 +11,6 @@ module('helper:is-href', function(hooks) {
this.render(hbs`{{is-href inputValue}}`);
assert.dom('*').hasText('1234');
assert.equal(this.element.textContent.trim(), '1234');
});
});

View File

@ -3,7 +3,7 @@ import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
module('helper:last', function(hooks) {
module('Integration | Helper | last', function(hooks) {
setupRenderingTest(hooks);
// Replace this with your real tests.
@ -12,6 +12,6 @@ module('helper:last', function(hooks) {
await render(hbs`{{last inputValue}}`);
assert.dom('*').hasText('/');
assert.equal(this.element.textContent.trim(), '/');
});
});

View File

@ -3,7 +3,7 @@ import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
module('helper:left-trim', function(hooks) {
module('Integration | Helper | left-trim', function(hooks) {
setupRenderingTest(hooks);
// Replace this with your real tests.
@ -12,6 +12,6 @@ module('helper:left-trim', function(hooks) {
await render(hbs`{{left-trim inputValue}}`);
assert.dom('*').hasText('1234');
assert.equal(this.element.textContent.trim(), '1234');
});
});

View File

@ -3,7 +3,7 @@ import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
module('helper:object-entries', function(hooks) {
module('Integration | Helper | object-entries', function(hooks) {
setupRenderingTest(hooks);
// Replace this with your real tests.
@ -12,6 +12,6 @@ module('helper:object-entries', function(hooks) {
await render(hbs`{{object-entries inputValue}}`);
assert.dom('*').hasText(Object.entries('1234').toString());
assert.equal(this.element.textContent.trim(), Object.entries('1234').toString());
});
});

View File

@ -3,7 +3,7 @@ import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
module('helper:policy/datacenters', function(hooks) {
module('Integration | Helper | policy/datacenters', function(hooks) {
setupRenderingTest(hooks);
// Replace this with your real tests.
@ -12,6 +12,6 @@ module('helper:policy/datacenters', function(hooks) {
await render(hbs`{{policy/datacenters inputValue}}`);
assert.dom('*').hasText('All');
assert.equal(this.element.textContent.trim(), 'All');
});
});

View File

@ -3,7 +3,7 @@ import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
module('helper:policy/typeof', function(hooks) {
module('Integration | Helper | policy/typeof', function(hooks) {
setupRenderingTest(hooks);
// Replace this with your real tests.
@ -12,6 +12,6 @@ module('helper:policy/typeof', function(hooks) {
await render(hbs`{{policy/typeof inputValue}}`);
assert.dom('*').hasText('role');
assert.equal(this.element.textContent.trim(), 'role');
});
});

View File

@ -3,7 +3,7 @@ import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
module('helper:right-trim', function(hooks) {
module('Integration | Helper | right-trim', function(hooks) {
setupRenderingTest(hooks);
// Replace this with your real tests.
@ -12,6 +12,6 @@ module('helper:right-trim', function(hooks) {
await render(hbs`{{right-trim inputValue}}`);
assert.dom('*').hasText('1234');
assert.equal(this.element.textContent.trim(), '1234');
});
});

View File

@ -3,7 +3,7 @@ import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
module('helper:service/external-source', function(hooks) {
module('Integration | Helper | service/external-source', function(hooks) {
setupRenderingTest(hooks);
// Replace this with your real tests.
@ -12,13 +12,13 @@ module('helper:service/external-source', function(hooks) {
await render(hbs`{{service/external-source inputValue}}`);
assert.dom('*').hasText('consul');
assert.equal(this.element.textContent.trim(), 'consul');
});
test('it renders prefixed', async function(assert) {
this.set('inputValue', { Meta: { 'external-source': 'consul' } });
await render(hbs`{{service/external-source inputValue prefix='external-source-'}}`);
assert.dom('*').hasText('external-source-consul');
assert.equal(this.element.textContent.trim(), 'external-source-consul');
});
});

View File

@ -3,7 +3,7 @@ import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
module('helper:slugify', function(hooks) {
module('Integration | Helper | slugify', function(hooks) {
setupRenderingTest(hooks);
// Replace this with your real tests.
@ -12,7 +12,7 @@ module('helper:slugify', function(hooks) {
await render(hbs`{{slugify inputValue}}`);
assert.dom('*').hasText('hi-there');
assert.equal(this.element.textContent.trim(), 'hi-there');
});
skip("it copes with more values such as ' etc");
});

View File

@ -3,7 +3,7 @@ import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
module('helper:split', function(hooks) {
module('Integration | Helper | split', function(hooks) {
setupRenderingTest(hooks);
// Replace this with your real tests.
@ -12,6 +12,6 @@ module('helper:split', function(hooks) {
await render(hbs`{{split inputValue}}`);
assert.dom('*').hasText('a,string,split,by,a,comma');
assert.equal(this.element.textContent.trim(), 'a,string,split,by,a,comma');
});
});

View File

@ -3,7 +3,7 @@ import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
module('helper:starts-with', function(hooks) {
module('Integration | Helper | starts-with', function(hooks) {
setupRenderingTest(hooks);
// Replace this with your real tests.
@ -12,6 +12,6 @@ module('helper:starts-with', function(hooks) {
await render(hbs`{{starts-with inputValue}}`);
assert.dom('*').hasText('false');
assert.equal(this.element.textContent.trim(), 'false');
});
});

View File

@ -3,7 +3,7 @@ import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
module('helper:substr', function(hooks) {
module('Integration | Helper | substr', function(hooks) {
setupRenderingTest(hooks);
// Replace this with your real tests.
@ -12,6 +12,6 @@ module('helper:substr', function(hooks) {
await render(hbs`{{substr inputValue -4}}`);
assert.dom('*').hasText('65f1');
assert.equal(this.element.textContent.trim(), '65f1');
});
});

View File

@ -3,7 +3,7 @@ import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
module('helper:token/is-anonymous', function(hooks) {
module('Integration | Helper | token/is-anonymous', function(hooks) {
setupRenderingTest(hooks);
// Replace this with your real tests.
@ -12,6 +12,6 @@ module('helper:token/is-anonymous', function(hooks) {
await render(hbs`{{token/is-anonymous inputValue}}`);
assert.dom('*').hasText('false');
assert.equal(this.element.textContent.trim(), 'false');
});
});

View File

@ -3,7 +3,7 @@ import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
module('helper:token/is-legacy', function(hooks) {
module('Integration | Helper | token/is-legacy', function(hooks) {
setupRenderingTest(hooks);
// Replace this with your real tests.
@ -12,6 +12,6 @@ module('helper:token/is-legacy', function(hooks) {
await render(hbs`{{token/is-legacy inputValue}}`);
assert.dom('*').hasText('false');
assert.equal(this.element.textContent.trim(), 'false');
});
});

File diff suppressed because it is too large Load Diff