Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/npm_and_yarn/multi-d983993043
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbilling authored Oct 20, 2024
2 parents 4670403 + 3059cbe commit a10cd6d
Show file tree
Hide file tree
Showing 12 changed files with 11,333 additions and 12,824 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
node-version: 18
cache: npm
- name: Install Dependencies
run: npm install --no-shrinkwrap
run: npm install --no-shrinkwrap --force
- name: Run Tests
run: npm run test:ember

Expand Down
24,015 changes: 11,229 additions & 12,786 deletions package-lock.json

Large diffs are not rendered by default.

49 changes: 25 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-cli-cloudinary-light",
"version": "0.12.0",
"version": "0.12.1",
"description": "Ember addon for Cloudinary without jquery",
"keywords": [
"ember-addon",
Expand Down Expand Up @@ -33,22 +33,22 @@
"test:ember-compatibility": "ember try:each"
},
"dependencies": {
"@babel/core": "^7.25.2",
"@babel/core": "^7.25.8",
"ember-cli-babel": "^8.2.0",
"ember-cli-htmlbars": "^6.3.0"
},
"devDependencies": {
"@babel/eslint-parser": "^7.24.7",
"@babel/plugin-proposal-decorators": "^7.24.7",
"@babel/eslint-parser": "^7.25.8",
"@babel/plugin-proposal-decorators": "^7.25.7",
"@ember/optional-features": "^2.1.0",
"@ember/test-helpers": "^3.3.0",
"@embroider/test-setup": "^3.0.3",
"@ember/test-helpers": "^4.0.4",
"@embroider/test-setup": "^4.0.0",
"@glimmer/component": "^1.1.2",
"@glimmer/tracking": "^1.1.2",
"broccoli-asset-rev": "^3.0.0",
"concurrently": "^8.2.2",
"ember-auto-import": "^2.7.4",
"ember-cli": "~5.9.0",
"concurrently": "^9.0.1",
"ember-auto-import": "^2.8.1",
"ember-cli": "~5.12.0",
"ember-cli-clean-css": "^3.0.0",
"ember-cli-dependency-checker": "^3.3.2",
"ember-cli-inject-live-reload": "^2.1.0",
Expand All @@ -57,27 +57,28 @@
"ember-fetch": "^8.1.2",
"ember-load-initializers": "^2.1.2",
"ember-page-title": "^8.2.3",
"ember-qunit": "^8.0.2",
"ember-resolver": "^11.0.1",
"ember-source": "~5.11.0",
"ember-qunit": "^8.1.0",
"ember-resolver": "^13.0.2",
"ember-source": "~5.12.0",
"ember-source-channel-url": "^3.0.0",
"ember-template-lint": "^5.13.0",
"ember-template-lint": "^6.0.0",
"ember-test-friendly-error-handler": "^3.0.0",
"ember-try": "^3.0.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-ember": "^11.12.0",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-qunit": "^8.1.1",
"eslint-plugin-ember": "^12.2.1",
"eslint-plugin-n": "^17.11.1",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-qunit": "^8.1.2",
"loader.js": "^4.7.0",
"pretender": "^3.4.7",
"prettier": "^3.3.1",
"qunit": "^2.21.0",
"qunit-dom": "^2.0.0",
"stylelint": "^15.11.0",
"stylelint-config-standard": "^34.0.0",
"stylelint-prettier": "^4.1.0",
"webpack": "^5.91.0"
"prettier": "^3.3.3",
"qunit": "^2.22.0",
"qunit-dom": "^3.2.1",
"stylelint": "^16.10.0",
"stylelint-config-standard": "^36.0.1",
"stylelint-prettier": "^5.0.2",
"webpack": "^5.95.0"
},
"peerDependencies": {
"ember-source": ">= 4.0.0"
Expand Down
9 changes: 9 additions & 0 deletions tests/dummy/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,20 @@ import Application from '@ember/application';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from 'dummy/config/environment';
import Ember from 'ember';
import buildErrorHandler from 'ember-test-friendly-error-handler';

export default class App extends Application {
modulePrefix = config.modulePrefix;
podModulePrefix = config.podModulePrefix;
Resolver = Resolver;
}

Ember.onerror = buildErrorHandler('Ember.onerror', (reason) => {
throw reason;
// reportErrorToService(reason);

// whatever else you might want here...
});

loadInitializers(App, config.modulePrefix);
6 changes: 4 additions & 2 deletions tests/dummy/app/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{{!-- The following component displays Ember's default welcome message. --}}
{{!-- Feel free to remove this! --}}
<TestComponent/>
{{page-title "Dummy"}}

<h2 id="title">Welcome to Ember</h2>

{{outlet}}
2 changes: 1 addition & 1 deletion tests/dummy/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": "5.9.0",
"version": "5.12.0",
"blueprints": [
{
"name": "addon",
Expand Down
11 changes: 10 additions & 1 deletion tests/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
setupRenderingTest as upstreamSetupRenderingTest,
setupTest as upstreamSetupTest,
} from 'ember-qunit';
import Ember from 'ember';

// This file exists to provide wrappers around ember-qunit's
// test setup functions. This way, you can easily extend the setup that is
Expand All @@ -23,8 +24,16 @@ function setupApplicationTest(hooks, options) {
// This is also a good place to call test setup functions coming
// from other addons:
//
// setupIntl(hooks); // ember-intl
// setupIntl(hooks, 'en-us'); // ember-intl
// setupMirage(hooks); // ember-cli-mirage

setupTest(hooks);

hooks.beforeEach(function () {
Ember.onerror = function (error) {
throw error;
};
});
}

function setupRenderingTest(hooks, options) {
Expand Down
25 changes: 22 additions & 3 deletions tests/integration/components/cloudinary-image-test.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { setupRenderingTest } from '../../helpers';
import { render, validateErrorHandler } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
import {
squelchErrorHandlerFor,
unsquelchAllErrorHandlers,
} from 'ember-test-friendly-error-handler';

module('Integration | Component | cloudinary image', function (hooks) {
setupRenderingTest(hooks);

hooks.afterEach(() => {
unsquelchAllErrorHandlers();
});

test('Ember.onerror is functioning properly', function (assert) {
let result = validateErrorHandler();
assert.ok(result.isValid, result.message);
});

test('it renders image', async function (assert) {
squelchErrorHandlerFor('Ember.onerror');
await render(hbs`<CloudinaryImage @publicId='test'/>`);
assert
.dom('img')
.hasAttribute('src', 'https://res.cloudinary.com/demo/image/upload/test');
});

test('it renders an image with width and height options', async function (assert) {
squelchErrorHandlerFor('Ember.onerror');
await render(
hbs`<CloudinaryImage @publicId='test' @options={{hash width='100' height='100'}}/>`,
);
Expand All @@ -29,6 +44,7 @@ module('Integration | Component | cloudinary image', function (hooks) {
});

test('it renders an image with width and height options in url and attributes', async function (assert) {
squelchErrorHandlerFor('Ember.onerror');
await render(
hbs`<CloudinaryImage @publicId='test' @options={{hash width='100' height='100' crop='fill'}}/>`,
);
Expand All @@ -44,6 +60,7 @@ module('Integration | Component | cloudinary image', function (hooks) {
});

test('it renders an image WHITOUT width and height options attributes for crop= limit', async function (assert) {
squelchErrorHandlerFor('Ember.onerror');
await render(
hbs`<CloudinaryImage @publicId='test' @options={{hash height='100' crop='limit'}}/>`,
);
Expand All @@ -58,6 +75,7 @@ module('Integration | Component | cloudinary image', function (hooks) {
assert.dom('img').doesNotHaveAttribute('height');
});
test('it renders an image WHITOUT width and height options attributes for crop= lfill', async function (assert) {
squelchErrorHandlerFor('Ember.onerror');
await render(
hbs`<CloudinaryImage @publicId='test' @options={{hash height='100' crop='lfill'}}/>`,
);
Expand All @@ -72,6 +90,7 @@ module('Integration | Component | cloudinary image', function (hooks) {
assert.dom('img').doesNotHaveAttribute('height');
});
test('it renders an image WHITOUT width and height options attributes for crop= fit', async function (assert) {
squelchErrorHandlerFor('Ember.onerror');
await render(
hbs`<CloudinaryImage @publicId='test' @options={{hash width='100' height='100' crop='fit'}}/>`,
);
Expand Down
11 changes: 9 additions & 2 deletions tests/integration/components/cloudinary-resource-list-test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { setupRenderingTest } from '../../helpers';
import { render, find } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { hbs } from 'ember-cli-htmlbars';
import Pretender from 'pretender';
import {
squelchErrorHandlerFor,
unsquelchAllErrorHandlers,
} from 'ember-test-friendly-error-handler';

module('Integration | Component | cloudinary-resource-list', function (hooks) {
setupRenderingTest(hooks);
Expand All @@ -12,6 +16,7 @@ module('Integration | Component | cloudinary-resource-list', function (hooks) {
});

hooks.afterEach(function () {
unsquelchAllErrorHandlers();
this.server.shutdown();
});

Expand All @@ -27,6 +32,7 @@ module('Integration | Component | cloudinary-resource-list', function (hooks) {
});

test('it renders cloudinary response in correct order', async function (assert) {
squelchErrorHandlerFor('Ember.onerror');
this.server.get(
'https://res.cloudinary.com/demo/image/list/test.json',
() => {
Expand Down Expand Up @@ -113,6 +119,7 @@ module('Integration | Component | cloudinary-resource-list', function (hooks) {
});

test('it fetches images without custom context', async function (assert) {
squelchErrorHandlerFor('Ember.onerror');
this.server.get(
'https://res.cloudinary.com/demo/image/list/test.json',
() => {
Expand Down
13 changes: 11 additions & 2 deletions tests/integration/components/cloudinary-video-test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { setupRenderingTest } from '../../helpers';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { hbs } from 'ember-cli-htmlbars';
import {
squelchErrorHandlerFor,
unsquelchAllErrorHandlers,
} from 'ember-test-friendly-error-handler';

module('Integration | Component | cloudinary video', function (hooks) {
setupRenderingTest(hooks);

hooks.afterEach(() => {
unsquelchAllErrorHandlers();
});

test('it renders a video', async function (assert) {
squelchErrorHandlerFor('Ember.onerror');
await render(hbs`<CloudinaryVideo @publicId='dog'/>`);
assert
.dom('source')
Expand Down
2 changes: 1 addition & 1 deletion tests/test-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ setApplication(Application.create(config.APP));

setup(QUnit.assert);

start();
start({ setupEmberOnerrorValidation: false });
12 changes: 11 additions & 1 deletion tests/unit/utils/variable-formatter-test.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
import variableFormatter from 'dummy/utils/variable-formatter';
import { module, test } from 'qunit';
import {
squelchErrorHandlerFor,
unsquelchAllErrorHandlers,
} from 'ember-test-friendly-error-handler';

module('Unit | Utility | variable formatter', function (hooks) {
hooks.afterEach(() => {
unsquelchAllErrorHandlers();
});

module('Unit | Utility | variable formatter', function () {
test('it works', function (assert) {
squelchErrorHandlerFor('Ember.onerror');
const options = { height: 200 };
let result = variableFormatter(options);
assert.strictEqual(result, '/h_200');
});

test('it works with more variables', function (assert) {
squelchErrorHandlerFor('Ember.onerror');
const options = { height: 200, crop: 'fit' };
let result = variableFormatter(options);
assert.strictEqual(result, '/h_200,c_fit');
Expand Down

0 comments on commit a10cd6d

Please sign in to comment.