Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/modules / ___dist / view-container / styles.test.js
Size: Mime:
"use strict";

var _react = _interopRequireDefault(require("react"));

var _templateHandler = require("./styles/templateHandler");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function removeWhitespace(string) {
  return string.replace(/(\s|\t|\n|\r| )+/, '');
}

test('transpiles correctly', () => {
  const result = _templateHandler.templateHandler`eh`;
  expect(result).toEqual('eh');
});
test('transpiles with theme', () => {
  _templateHandler.templateHandler.setTheme({
    moose: 'moose'
  });

  const canada = '.canada${}';
  const result = _templateHandler.templateHandler`
    ${canada}
    .eh {
      border-color: hotpink;
      color: ${theme => theme && theme.moose};
    }
  `;
  const expectedRaw = `
    ${canada}
    .eh {
      border-color: hotpink;
      color: moose;
    }
  `;
  const actual = removeWhitespace(result);
  const expected = removeWhitespace(expectedRaw);
  expect(actual).toEqual(expected);
});
test('works with selectors', () => {
  console.log('@TODO render a style');
});
test('works without selectors', () => {
  console.log('@TODO render a style withId');
});
test('works with media queries', () => {
  // @mixin phone-or-smaller
  const media = styled.todo`
    desktopOrLarger() { color: tomato; }
    tabletOrLarger() { color: tomato; }
    phoneOrLarger() { color: tomato; }
    desktopOrSmaller() { color: tomato; }
    tabletOrSmaller() { color: tomato; }
    phoneOrSmaller() { color: tomato; }
  `;
});
test('getSelector', () => {
  var _dec, _class;

  const styled = require("./styles/styled");

  const styles = styled.todo`
    color: hotpink;
  `;
  let Eh = (_dec = styles(), _dec(_class = class Eh extends _react.default.Component {}) || _class); // const renderedToString = Eh
  // const expectedStyle = `
  //   .Eh-1 {
  //     color: hotpink;
  //   }
  // `
}); // desktopOrLarger()
// tabletOrLarger()
// desktopOrSmaller()
// tabletOrSmaller()
// phoneOrSmaller()
// phoneOrLarger()