Skip to content

Instantly share code, notes, and snippets.

View kcmr's full-sized avatar

Kus Cámara kcmr

View GitHub Profile
@kcmr
kcmr / one-way-binding.html
Last active December 27, 2017 17:32
one-way data binding in Polymer
<dom-module id="my-component">
<template>
<paper-toast text="[[greeting]]"></paper-toast>
</template>
<script>
Polymer({
is: 'my-component',
properties: {
@kcmr
kcmr / customElement.sublime-snippet
Last active January 31, 2018 23:49
Polymer Custom Element (Class based - Polymer 2)
<snippet>
<content><![CDATA[
<dom-module id="${1:custom-element}">
<template>
<style>
:host {
display: block;
}
</style>
</template>
@kcmr
kcmr / index.html
Created March 18, 2018 02:25
VSCode logo loading animation with Anime.js
<svg width="160" height="160" viewBox="0 0 160 160" class="vscode-logo">
<g>
<path class="p1" d="M 3 115 L 3 115 L 16 120 L 16 120 L 3 115 Z"></path>
<path class="p2" d="M 112 6 L 148 21 L 148 21 L 112 6 L 112 6 Z"></path>
<path class="p3" d="M 148 135 L 112 152 L 112 152 L 148 135 L 148 135 Z"></path>
</g>
</svg>
@kcmr
kcmr / cloudSettings
Last active October 27, 2018 22:08
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-10-27T22:08:26.910Z","extensionVersion":"v3.2.0"}
@kcmr
kcmr / keybindings.json
Last active June 17, 2018 01:09
VS Code keybindings for working with Polymer (data binding and custom attributes)
{
"key": "shift+'",
"command": "editor.action.insertSnippet",
"when": "editorTextFocus && editorLangId == html",
"args": {
"snippet": "\"$1\""
}
},
{
"key": "'",
suite('Setting "opened" as true', () => {
const sut = fixture('someId');
suiteSetup(() => {
sut.opened = true;
});
test('opens the modal', () => {
assert.isTrue(isVisible(sut));
});
test('calling toggle() method changes the modal visibility', () => {
// Arrange
const initialVisibility = isVisilble(sut); // false
// Act
sut.toggle();
// Assert
assert.notEqual(isVisilble(sut), initialVisibility);
});
test('setting "opened" as true opens the modal', () => {
// Act
sut.opened = true;
// Assert
assert.isTrue(isVisilble(sut));
});
describe('<my-modal>', () => {
// context es un alias de describe
context('setting "opened" as true', () => {
// fixture instancia el componente
const sut = fixture('someId');
// Se ejecuta una vez antes de todos los tests de este bloque
before(() => {
sut.opened = true;
});
suite('<my-modal>', () => {
suite('setting "opened" as true', () => {
// fixture instancia el componente
const sut = fixture('someId');
// Se ejecuta una vez antes de todos los tests de este bloque
suiteSetup(() => {
sut.opened = true;
});