Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes regression in resource list component #15

Merged
merged 5 commits into from
Sep 20, 2018
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
4 changes: 0 additions & 4 deletions .bowerrc

This file was deleted.

9 changes: 3 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ env:
global:
# See https://git.io/vdao3 for details.
- JOBS=1
matrix:
fast_finish: true

jobs:
fail_fast: true
allow_failures:
- env: EMBER_TRY_SCENARIO=ember-canary

Expand All @@ -42,15 +43,11 @@ matrix:
- env: EMBER_TRY_SCENARIO=ember-release
- env: EMBER_TRY_SCENARIO=ember-beta
- env: EMBER_TRY_SCENARIO=ember-canary
# - env: EMBER_TRY_SCENARIO=ember-default-with-jquery

before_install:
- npm config set spin false
- npm install -g npm@4
- npm --version

script:
- npm run lint:js
# Usually, it's ok to finish the test scenario without reverting
# to the addon's original dependency state, skipping "cleanup".
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO
2 changes: 1 addition & 1 deletion addon/components/cloudinary-resource-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const CloudinaryResourceList = Component.extend({
})

set(this, 'items', response.resources);
return response;
return response.resources;
}
});

Expand Down
4 changes: 0 additions & 4 deletions bower.json

This file was deleted.

9 changes: 1 addition & 8 deletions config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,8 @@ module.exports = function() {
getChannelURL('canary')
]).then((urls) => {
return {
useYarn: true,
scenarios: [
{
name: 'ember-lts-2.12',
npm: {
devDependencies: {
'ember-source': '~2.12.0'
}
}
},
{
name: 'ember-lts-2.16',
npm: {
Expand Down
18 changes: 12 additions & 6 deletions tests/integration/components/cloudinary-resource-list-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { module, test, only } from 'qunit';
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, find } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
Expand All @@ -7,6 +7,14 @@ import Pretender from 'pretender';
module('Integration | Component | cloudinary-resource-list', function (hooks) {
setupRenderingTest(hooks);

hooks.beforeEach(function() {
this.server = new Pretender();
});

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

test('it gracefully handles fetch error', async function (assert) {
await render(hbs`
{{#cloudinary-resource-list 'test' as |resourceList|}}
Expand All @@ -18,8 +26,7 @@ module('Integration | Component | cloudinary-resource-list', function (hooks) {
});

test('it renders cloudinary response in correct order', async function (assert) {
let server = new Pretender();
server.get('https://res.cloudinary.com/cloudinary-test/image/list/test.json', () => {
this.server.get('https://res.cloudinary.com/cloudinary-test/image/list/test.json', () => {
let cloudinaryResourceListResponse = {
'resources': [{
public_id: 'my_project/image_b',
Expand Down Expand Up @@ -84,9 +91,8 @@ module('Integration | Component | cloudinary-resource-list', function (hooks) {
assert.ok(find('span:nth-child(3)').textContent.trim().endsWith('image_c'), 'Image C order is OK');
});

only('it fetches images without custom context', async function(assert) {
let server = new Pretender();
server.get('https://res.cloudinary.com/cloudinary-test/image/list/test.json', () => {
test('it fetches images without custom context', async function(assert) {
this.server.get('https://res.cloudinary.com/cloudinary-test/image/list/test.json', () => {
let cloudinaryResourceListResponse = {
resources: [
{
Expand Down
Loading