Skip to content

Commit f50cdb0

Browse files
joshsmithbegedin
authored andcommitted
Fix conversation-list-item reopen link CSS (#1646)
* Fix conversation-list-item reopen link CSS * Fix failing test caused by CSS change
1 parent 818cd93 commit f50cdb0

3 files changed

Lines changed: 35 additions & 8 deletions

File tree

app/styles/components/conversations/conversation-list-item.scss

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
&:hover {
1818
background: $blue--background;
1919

20-
.conversation-list-item__close-link {
20+
.conversation-list-item__close-link,
21+
.conversation-list-item__reopen-link {
2122
display: block;
2223
}
2324
}
@@ -34,7 +35,8 @@
3435
.conversation-list-item__name,
3536
.conversation-list-item__username,
3637
.conversation-list-item__timestamp,
37-
.conversation-list-item__close-link {
38+
.conversation-list-item__close-link,
39+
.conversation-list-item__reopen-link {
3840
color: white;
3941
}
4042
}
@@ -76,7 +78,7 @@
7678
margin: 0;
7779
}
7880

79-
&__close-link {
81+
&__close-link, &__reopen-link {
8082
display: none;
8183
font-size: $body-font-size-normal;
8284
padding: 0.5em;

app/templates/components/conversations/conversation-list-item-with-user.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
{{#if (eq conversation.status 'open')}}
2222
{{!-- bubbles=false to prevent bubbling to wrapping link-to element --}}
2323
<span data-test-close-link class="conversation-list-item__close-link" {{action close conversation bubbles=false}}>
24-
{{fa-icon "check"}}<span>Close</span>
24+
{{fa-icon "check"}} <span>Close</span>
2525
</span>
2626
{{else if (eq conversation.status 'closed')}}
2727
<span data-test-reopen-link class="conversation-list-item__reopen-link" {{action reopen conversation bubbles=false}}>
28-
{{fa-icon "inbox"}}<span>Reopen</span>
28+
{{fa-icon "inbox"}} <span>Reopen</span>
2929
</span>
3030
{{/if}}
3131
</div>

tests/integration/components/conversations/conversation-list-item-with-user-test.js

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,30 @@ test('it renders the conversation details', function(assert) {
5555
assert.equal(page.closeButton.text, 'Close', 'Close button text is correct');
5656
});
5757

58-
test('it does not render close button when conversation is closed', function(assert) {
58+
test('it renders close button when conversation is open', function(assert) {
59+
assert.expect(3);
60+
61+
let user = {
62+
username: 'testuser'
63+
};
64+
65+
let conversation = {
66+
status: 'open',
67+
user
68+
};
69+
70+
set(this, 'conversation', conversation);
71+
72+
renderPage();
73+
74+
// we use isPresent because the buttons only display on hover and are
75+
// otherwise set to `display: none;`
76+
assert.ok(page.closeButton.isPresent, 'Close button is rendered');
77+
assert.notOk(page.reopenButton.isPresent, 'Reopen button is not rendered');
78+
assert.equal(page.closeButton.text, 'Close', 'Close button text is correct');
79+
});
80+
81+
test('it renders reopen button when conversation is closed', function(assert) {
5982
assert.expect(3);
6083

6184
let user = {
@@ -71,8 +94,10 @@ test('it does not render close button when conversation is closed', function(ass
7194

7295
renderPage();
7396

74-
assert.notOk(page.closeButton.isVisible, 'Close button is hidden');
75-
assert.ok(page.reopenButton.isVisible, 'Reopen button is visible');
97+
// we use isPresent because the buttons only display on hover and are
98+
// otherwise set to `display: none;`
99+
assert.notOk(page.closeButton.isPresent, 'Close button is not rendered');
100+
assert.ok(page.reopenButton.isPresent, 'Reopen button is rendered');
76101
assert.equal(page.reopenButton.text, 'Reopen', 'Reopen button text is correct');
77102
});
78103

0 commit comments

Comments
 (0)