PHPNews

Setting Data and Asserting Styles

Written by Laracasts - Published on Laracasts
Aggregated on Monday October 16, 2017 - Permalink

When preparing your tests, you'll often want to first set the stage. "Given that the component's data is in this state, when I...". To allow for this, we can use the setData() method on the wrapper instance. Additionally, we can use hasStyles() to write assertions against any relevant inline CSS styles. This can be useful for asserting against visibility. View the source code for this episode on …

Continue reading »


An Administrator May Lock Any Thread: Part 4

Written by Laracasts - Published on Laracasts
Aggregated on Monday October 16, 2017 - Permalink

The basic UI functionality is in place. At this point, we only need to send the appropriate AJAX requests to toggle the "locked" column within the threads table. View the source code for this episode on GitHub.

Continue reading »


An Administrator May Lock Any Thread: Part 3

Written by Laracasts - Published on Laracasts
Aggregated on Monday October 16, 2017 - Permalink

Now that we have the server-side endpoints fully tested, let's switch to the front-end and write the necessary Vue code to allow administrators to toggle a thread's "locked" status.

Continue reading »


An Administrator May Lock Any Thread: Part 2

Written by Laracasts - Published on Laracasts
Aggregated on Friday October 13, 2017 - Permalink

Let's continue fleshing out the routes and controllers that our front-end will expect for this feature. In this episode, we'll review two endpoint approaches for updating a thread's "locked" status. View the source code for this episode on GitHub.

Continue reading »


Test Single File Components

Written by Laracasts - Published on Laracasts
Aggregated on Friday October 13, 2017 - Permalink

It took a bit of work to setup the necessary dependencies, but we're now successfully testing our Vue components. In this episode, we'll take things a step further and switch over to testing single-file Vue components. To allow for this, we'll need to use webpack to pre-compile these .vue files. View the source code for this episode on GitHub.

Continue reading »


TDD Your First Vue Component From Scratch

Written by Laracasts - Published on Laracasts
Aggregated on Thursday October 12, 2017 - Permalink

Let's dive in. We'll begin by pulling in all necessary dependencies. Most importantly, we'll be leveraging vue-test-utils, which is the official unit testing library for Vue. Once everything has been installed, we can begin using TDD to build a simple Vue component. View the source code for this episode on GitHub.

Continue reading »