Skip to content

Commit

Permalink
#112: Converting source to es6
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrowd committed Apr 26, 2017
1 parent ebb48d8 commit 8f0588d
Show file tree
Hide file tree
Showing 9 changed files with 372 additions and 379 deletions.
8 changes: 4 additions & 4 deletions src/CSSTranslate.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module.exports = function (position, axis) {
var positionCss = (axis === 'horizontal') ? [position, 0, 0] : [0, position, 0];
var transitionProp = 'translate3d';
export default (position, axis) => {
const positionCss = (axis === 'horizontal') ? [position, 0, 0] : [0, position, 0];
const transitionProp = 'translate3d';

var translatedPosition = '(' + positionCss.join(',') + ')';
const translatedPosition = '(' + positionCss.join(',') + ')';

return transitionProp + translatedPosition;
};
13 changes: 12 additions & 1 deletion src/__tests__/Carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import React from 'react';
import ReactDOM from 'react-dom';
import { shallow, mount } from 'enzyme';
import renderer from 'react-test-renderer';
import * as index from '../index';

describe("Slider", function() {
jest.autoMockOff();

const Carousel = require('../components/Carousel');
const Carousel = require('../components/Carousel').default;
const Thumbs = require('../components/Thumbs').default;

let component, componentInstance, totalChildren, lastItemIndex;

Expand Down Expand Up @@ -49,6 +51,15 @@ describe("Slider", function() {
renderDefaultComponent({});
});

describe("Exports", () => {
it('should export Carousel from the main index file', () => {
expect(index.Carousel).toBe(Carousel);
});
it('should export Thumbs from the main index file', () => {
expect(index.Thumbs).toBe(Thumbs);
});
});

describe("Basics", () => {
describe("DisplayName", () => {
it('should be Carousel', () => {
Expand Down
Loading

0 comments on commit 8f0588d

Please sign in to comment.