This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function nodeTreePath(element) { | |
const path = []; | |
let currentEl = element; | |
while (currentEl) { | |
path.push(currentEl); | |
currentEl = currentEl.parentElement; | |
} | |
return path; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jest.mock('@/Api', () => require('@/ApiMock')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default { | |
fetchData() { | |
return Promise.then({ | |
message: 'This is a static value', | |
}); | |
}, | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default { | |
fetchData() { | |
return fetch('/application-data/'); | |
.then(function() { | |
return response.json(); | |
}); | |
}, | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
rootDir: './webapp', | |
moduleFileExtensions: ['vue', 'js', 'json', 'jsx', 'node'], | |
moduleNameMapper: { | |
'^@/(.*)$': '<rootDir>src/$1', | |
}, | |
mapCoverage: true, | |
transform: { | |
'^.+\\.jsx?$': 'babel-jest', | |
'^.*\\.(vue)$': 'jest-vue', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
rootDir: './webapp', | |
moduleFileExtensions: ['vue', 'js', 'json', 'jsx', 'node'], | |
moduleNameMapper: { | |
'^@/(.*)$': '<rootDir>src/$1', | |
}, | |
mapCoverage: true, | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Import jQuery to be used on this file | |
import jQuery from 'jquery'; | |
// Expose jQuery to window to be used by | |
// other external scripts such as your Angular application | |
window.jQuery = jQuery; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<h1>Hello {{ subject }}!</h1> | |
</template> | |
<script> | |
export default { | |
name: 'hello-subject', | |
props: { | |
subject: { | |
type: String, | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="HelloSubject"> | |
<h1>Hello {{ subject }}!</h1> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function SampleAngularController($scope, $element) { | |
// Create mounting point | |
const MountingPoint = document.createElement('div'); | |
// Place mounting point in target location | |
$element.appendChild(MountingPoint); | |
// Create Vue component | |
const ComponentVM = new Component({ | |
propsData: { |
NewerOlder