Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Application from '@ember/application';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';
import config from 'ember-octane-vs-classic-cheat-sheet/config/environment';

export default class App extends Application {
modulePrefix = config.modulePrefix;
Expand Down
1 change: 1 addition & 0 deletions app/components/code-snippet/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
data-test-code-snippet
@code={{snippet.source}}
@language={{get-prism-language snippet.language}}
@showLineNumbers={{true}}
/>
{{/let}}
2 changes: 1 addition & 1 deletion app/router.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import EmberRouter from '@ember/routing/router';
import config from './config/environment';
import config from 'ember-octane-vs-classic-cheat-sheet/config/environment';

export default class Router extends EmberRouter {
location = config.locationType;
Expand Down
2 changes: 1 addition & 1 deletion config/ember-cli-update.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"packages": [
{
"name": "ember-cli",
"version": "3.19.0",
"version": "3.20.0",
"blueprints": [
{
"name": "app",
Expand Down
5 changes: 3 additions & 2 deletions config/targets.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ const browsers = [
'last 1 Safari versions'
];

const isCI = !!process.env.CI;
const isCI = Boolean(process.env.CI);
const isProduction = process.env.EMBER_ENV === 'production';

if (isCI || isProduction) {
browsers.push('ie 11');
}

module.exports = {
browsers
browsers,
node: 'current'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

};
3 changes: 3 additions & 0 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ module.exports = function(defaults) {
'handlebars', 'markup-templating', // handlebars
'bash' // shell
],
plugins: [
'line-numbers'
]
},

prember: {
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
},
"devDependencies": {
"@ember/optional-features": "^1.3.0",
"@glimmer/component": "^1.0.0",
"@glimmer/tracking": "^1.0.0",
"@glimmer/component": "^1.0.1",
"@glimmer/tracking": "^1.0.1",
"@percy/ember": "^2.1.3",
"babel-eslint": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"ember-auto-import": "^1.6.0",
"ember-cli": "~3.19.0",
"ember-cli": "~3.20.0",
"ember-cli-app-version": "^3.2.0",
"ember-cli-babel": "^7.20.5",
"ember-cli-babel": "^7.21.0",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-deploy": "^1.0.2",
"ember-cli-deploy-build": "^2.0.0",
Expand All @@ -46,19 +46,19 @@
"ember-intl": "^5.3.1",
"ember-load-initializers": "^2.1.1",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-prism": "^0.7.0",
"ember-prism": "^0.8.0",
"ember-qunit": "^4.6.0",
"ember-resolver": "^8.0.0",
"ember-source": "~3.19.0",
"ember-source": "~3.20.2",
"ember-template-lint": "^2.9.1",
"ember-test-selectors": "^4.1.0",
"eslint": "^7.5.0",
"eslint-plugin-ember": "^8.9.1",
"eslint": "^7.6.0",
"eslint-plugin-ember": "^8.9.2",
"eslint-plugin-node": "^11.1.0",
"loader.js": "^4.7.0",
"npm-run-all": "^4.1.5",
"prember": "^1.0.5",
"qunit-dom": "^1.2.0"
"qunit-dom": "^1.3.0"
},
"engines": {
"node": "10.* || >= 12"
Expand Down
12 changes: 1 addition & 11 deletions tests/integration/components/guide-section/component-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@ import { setupIntl } from 'ember-intl/test-support';
import { setupRenderingTest } from 'ember-qunit';
import { module, test } from 'qunit';

// TODO: There may be a bug in ember-prism v0.7.0.
//
// Possibly due to its use of classic component and splattributes, I noticed that
// the test selector for <CodeSnippet> appears twice in development and testing
// environments. One on the <pre> tag and another on the <code> tag inside.
//
// Once the bug is fixed and the addon is updated for this app, remove the use of
// `numDuplicates`.
const numDuplicates = 2;

module('Integration | Component | guide-section', function(hooks) {
setupRenderingTest(hooks);
setupIntl(hooks, 'en-us', {
Expand Down Expand Up @@ -81,7 +71,7 @@ module('Integration | Component | guide-section', function(hooks) {
.includesText('Actions');

assert.dom('[data-test-subsection]').exists({ count: 3 });
assert.dom('[data-test-code-snippet]').exists({ count: 9 * numDuplicates });
assert.dom('[data-test-code-snippet]').exists({ count: 9 });
assert.dom('[data-test-general-text]').exists({ count: 1 });
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@ import { setupIntl } from 'ember-intl/test-support';
import { setupRenderingTest } from 'ember-qunit';
import { module, test } from 'qunit';

// TODO: There may be a bug in ember-prism v0.7.0.
//
// Possibly due to its use of classic component and splattributes, I noticed that
// the test selector for <CodeSnippet> appears twice in development and testing
// environments. One on the <pre> tag and another on the <code> tag inside.
//
// Once the bug is fixed and the addon is updated for this app, remove the use of
// `numDuplicates`.
const numDuplicates = 2;

module('Integration | Component | guide-section/subsection', function(hooks) {
setupRenderingTest(hooks);
setupIntl(hooks, 'en-us', {
Expand All @@ -39,12 +29,12 @@ module('Integration | Component | guide-section/subsection', function(hooks) {

const emberClassic = this.element.querySelector('[data-test-ember-classic]');

assert.dom('[data-test-code-snippet]', emberClassic).exists({ count: 0 * numDuplicates });
assert.dom('[data-test-code-snippet]', emberClassic).exists({ count: 0 });
assert.dom('[data-test-general-text]', emberClassic).exists({ count: 0 });

const emberOctane = this.element.querySelector('[data-test-ember-octane]');

assert.dom('[data-test-code-snippet]', emberOctane).exists({ count: 0 * numDuplicates });
assert.dom('[data-test-code-snippet]', emberOctane).exists({ count: 0 });
assert.dom('[data-test-general-text]', emberOctane).exists({ count: 0 });
});

Expand Down Expand Up @@ -76,12 +66,12 @@ module('Integration | Component | guide-section/subsection', function(hooks) {

const emberClassic = this.element.querySelector('[data-test-ember-classic]');

assert.dom('[data-test-code-snippet]', emberClassic).exists({ count: 1 * numDuplicates });
assert.dom('[data-test-code-snippet]', emberClassic).exists({ count: 1 });
assert.dom('[data-test-general-text]', emberClassic).exists({ count: 0 });

const emberOctane = this.element.querySelector('[data-test-ember-octane]');

assert.dom('[data-test-code-snippet]', emberOctane).exists({ count: 1 * numDuplicates });
assert.dom('[data-test-code-snippet]', emberOctane).exists({ count: 1 });
assert.dom('[data-test-general-text]', emberOctane).exists({ count: 0 });
});

Expand Down Expand Up @@ -118,12 +108,12 @@ module('Integration | Component | guide-section/subsection', function(hooks) {

const emberClassic = this.element.querySelector('[data-test-ember-classic]');

assert.dom('[data-test-code-snippet]', emberClassic).exists({ count: 4 * numDuplicates });
assert.dom('[data-test-code-snippet]', emberClassic).exists({ count: 4 });
assert.dom('[data-test-general-text]', emberClassic).exists({ count: 0 });

const emberOctane = this.element.querySelector('[data-test-ember-octane]');

assert.dom('[data-test-code-snippet]', emberOctane).exists({ count: 3 * numDuplicates });
assert.dom('[data-test-code-snippet]', emberOctane).exists({ count: 3 });
assert.dom('[data-test-general-text]', emberOctane).exists({ count: 0 });
});

Expand Down Expand Up @@ -153,12 +143,12 @@ module('Integration | Component | guide-section/subsection', function(hooks) {

const emberClassic = this.element.querySelector('[data-test-ember-classic]');

assert.dom('[data-test-code-snippet]', emberClassic).exists({ count: 1 * numDuplicates });
assert.dom('[data-test-code-snippet]', emberClassic).exists({ count: 1 });
assert.dom('[data-test-general-text]', emberClassic).exists({ count: 0 });

const emberOctane = this.element.querySelector('[data-test-ember-octane]');

assert.dom('[data-test-code-snippet]', emberOctane).exists({ count: 0 * numDuplicates });
assert.dom('[data-test-code-snippet]', emberOctane).exists({ count: 0 });
assert.dom('[data-test-general-text]', emberOctane).exists({ count: 1 });
assert.dom('[data-test-general-text]', emberOctane)
.includesText('See Do you need Ember Object? for alternatives to mixins');
Expand Down
4 changes: 2 additions & 2 deletions tests/test-helper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Application from '../app';
import config from '../config/environment';
import Application from 'ember-octane-vs-classic-cheat-sheet/app';
import config from 'ember-octane-vs-classic-cheat-sheet/config/environment';
import { setApplication } from '@ember/test-helpers';
import { start } from 'ember-qunit';

Expand Down
Loading