Skip to content

Commit

Permalink
chore(Walk): Lint and test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
danactive committed Jun 20, 2020
1 parent 63ac5b4 commit 222b3a9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 25 deletions.
2 changes: 2 additions & 0 deletions api/app/components/Img/test/index.jest.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* global describe, expect, shallow, test */

import React from 'react';

import Img from '../index';
Expand Down
2 changes: 2 additions & 0 deletions api/app/components/ThumbImg/test/index.jest.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* global describe, expect, shallow, test */

import React from 'react';

import Img from '../index';
Expand Down
17 changes: 9 additions & 8 deletions api/server/plugins/walk/test/files.jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@
const { listFiles } = require('../lib/files');

describe('Walk API', () => {
function matchFile(expect, file) {
expect(file.filename).toEqual('P1160066.JPG');
expect(file.ext).toEqual('JPG');
expect(file.mediumType).toEqual('image');
expect(file.name).toEqual('P1160066');
}

test('Read files in folder', async () => {
const { files } = await listFiles('test/fixtures/walkable');
expect(files[1].filename).toEqual('P1160066.JPG');
expect(files[1].ext).toEqual('JPG');
expect(files[1].mediumType).toEqual('image');
expect(files[1].name).toEqual('P1160066');
matchFile(expect, files[1]);
expect(files.length).toEqual(3);
});

test('Read files in folder (w/ space)', async () => {
const { files } = await listFiles('test/fixtures/walk%20able');
expect(files[0].filename).toEqual('P1160066.JPG');
expect(files[0].ext).toEqual('JPG');
expect(files[0].mediumType).toEqual('image');
expect(files[0].name).toEqual('P1160066');
matchFile(expect, files[0]);
expect(files.length).toEqual(1);
});
});

This file was deleted.

0 comments on commit 222b3a9

Please sign in to comment.