Skip to content

Instantly share code, notes, and snippets.

View jdberrocal1's full-sized avatar

Daniel Berrocal jdberrocal1

  • LTVCo
  • Costa Rica
View GitHub Profile
@jdberrocal1
jdberrocal1 / report-rating-container-test.js
Created August 14, 2021 21:19
Ember Test Example (medium++)
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, click, fillIn } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { resolve } from 'rsvp';
const SetUpComponent = async function (context, params) {
context.setProperties({
parentReportModel: params.parentReportModel,
rating: params.rating,
@jdberrocal1
jdberrocal1 / recent-report-item-test.js
Last active August 14, 2021 17:23
Ember Test Example (medium)
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
const SetUpComponent = async function (context, params) {
context.setProperties({
report: params.report,
editReports: params.editReports,
isMobileFreeUser: params.isMobileFreeUser,
@jdberrocal1
jdberrocal1 / thousand-limit-reached-test.js
Last active August 6, 2021 21:09
Ember Test Example (easy)
//Component thousand-limit-reached
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
module('Integration | Component | thousand limit reached', function (hooks) {
setupRenderingTest(hooks);
@jdberrocal1
jdberrocal1 / get_horoscope_sign_by_dob.js
Last active September 30, 2021 00:48
Get Horoscope Sign By DOB (Javascript)
const SIGN_NAMES = [
{
sign: 'Aquarius',
start: {
day: 20,
month: 1,
},
end: {
day: 18,
month: 2,
@jdberrocal1
jdberrocal1 / JavaScript Function Definitions
Last active January 18, 2018 18:19
JavaScript Function Definitions
1. Named Function Declaration:
function test () {
// code
}
2. Anonymous Function Declaration (Usually callbacks)
array.forEach(function (item){})
3. Named Function Expression
var x = function test (a, b) {return a * b};