/** @test */ public function it_add_an_import_for_a_vue_component_in_the_assembler_file() { $report = VueAssembler::vue()->addComponent('example-component', './components/ExampleComponent.vue'); $this->assertEquals($report, 'SUCCESS'); $fileContent = File::get($this->exampleFile); $contentShouldExist = "Vue.component('example-component', Vue.extend(require('./components/ExampleComponent.vue')));"; $this->assertContains($contentShouldExist, $fileContent); }
/** * * Setup Vue. * * @return void */ protected function setUpVue() { $this->describeMethod('Setup vue-system'); $this->copyVueStubs(); $report = ElixirFile::addScript('backend.js'); $this->reportStep('add task for publishing backend.js in elixir-file', $report); $report = VueAssembler::web()->addPage('login-page', './pages/LoginPage.vue'); $this->reportStep('require LoginPage.vue in web.js', $report); $report = VueAssembler::web()->addPage('request-password-page', './pages/RequestPasswordPage.vue'); $this->reportStep('require RequestPasswordPage.vue in web.js', $report); $report = VueAssembler::web()->addPage('reset-password-page', './pages/ResetPasswordPage.vue'); $this->reportStep('require ResetPasswordPage.vue in web.js', $report); }
/** * Configure Vue. * * @return void */ protected function setUpVue() { $this->describeMethod('Setup Vue'); File::copyDirectory("{$this->packagePath}/vue/components", "{$this->vuePath}/components"); $this->reportStep('copy vue files to app', 'SUCCESS'); $report = VueAssembler::web()->addComponent('navbar', './components/NavbarComponent.vue'); $report = VueAssembler::web()->addComponent('flash-alert', './components/FlashAlert.vue'); $this->reportStep('require NavbarComponent in web.js', $report); }