Skip to content
This repository has been archived by the owner on Oct 10, 2018. It is now read-only.

Commit

Permalink
Rename data widget attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
erik-epineer committed Sep 24, 2018
1 parent d8f73de commit 3daacc9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/PersonalRecentVisitsWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function __construct(RecentVisitsRepository $repository)

public function toHtml()
{
return '<aside data-kontour-widget-name="PersonalRecentVisitsWidget"><header>Recent</header><ul>' . $this->getVisits()->map(function ($visit) {
return '<aside data-kontour-widget="PersonalRecentVisitsWidget"><header>Recent</header><ul>' . $this->getVisits()->map(function ($visit) {
return '<li data-kontour-visit-type="' . $visit->getType() . '">' . $visit->getLink()->toHtml() . '</li>';
})->implode("\n") . '</ul></aside>';
}
Expand Down
2 changes: 1 addition & 1 deletion src/TeamRecentVisitsWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function __construct(RecentVisitsRepository $repository)

public function toHtml()
{
return '<aside data-kontour-widget-name="TeamRecentVisitsWidget"><header>Team Recent</header><ul>' . $this->getVisits()->map(function ($visit) {
return '<aside data-kontour-widget="TeamRecentVisitsWidget"><header>Team Recent</header><ul>' . $this->getVisits()->map(function ($visit) {
return '<li data-kontour-visit-type="' . $visit->getType() . '" data-kontour-username="' . $visit->getUser()->getDisplayName() . '">' . $visit->getLink()->toHtml() . '</li>';
})->implode("\n") . '</ul></aside>';
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/UserlandControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function test_recent_visits_widgets()
$response->assertOk();

// Check personal links
$response->assertSee('<aside data-kontour-widget-name="PersonalRecentVisitsWidget">');
$response->assertSee('<aside data-kontour-widget="PersonalRecentVisitsWidget">');
$response->assertSee('<header>Recent</header>');

$numberOfMatches = substr_count($response->content(), '<li data-kontour-visit-type="show"><a href="' . route('userland.index') . '">Recent Userland Tool</a>');
Expand All @@ -73,7 +73,7 @@ public function test_recent_visits_widgets()
$this->assertEquals(1, $numberOfMatches);

// Check team links
$response->assertSee('<aside data-kontour-widget-name="TeamRecentVisitsWidget">');
$response->assertSee('<aside data-kontour-widget="TeamRecentVisitsWidget">');
$response->assertSee('<header>Team Recent</header>');

$numberOfMatches = substr_count($response->content(), '<li data-kontour-visit-type="edit" data-kontour-username="' . $otherUser->getDisplayName() . '"><a href="' . route('userland.edit') . '">Other Recent Userland Tool</a>');
Expand Down

0 comments on commit 3daacc9

Please sign in to comment.