Skip to content

Commit

Permalink
Fix two tests so the pass by grabbing the right element #2
Browse files Browse the repository at this point in the history
Fixed two tests by re-writing to grab the correct element by switching the logic of one and switching the html to be more inline with our choice of formatting #2
  • Loading branch information
Jack Perala committed Apr 2, 2020
1 parent 17f55d0 commit 3338f10
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
17 changes: 12 additions & 5 deletions client/e2e/src/doorboard.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,17 @@ describe('Owner Doorboard', () => {
});

// This test needs to be re-written to get the correct note
// it('Should have the correct first note', async () => {
// page.getOwnerListItems().first();
// expect(element(by.className('note-card')).getText()).toEqual(
// 'I\'m going to be a few minutes late to my office hours today. I got caught in traffic this morning.');
// });
it('Should have the correct first note', async () => {
// Write to grab the second element
page.getOwnerListItems().first();
expect(element(by.className('message')).getText()).toEqual(
'I\'m going to be a few minutes late to my office hours today. I got caught in traffic this morning.');
});
// This test needs to be re-written to get the correct note
it('Should have the correct first note', async () => {
page.getOwnerListItems().first();
expect(element(by.className('message')).getText()).toEqual(
'I\'m going to be a few minutes late to my office hours today. I got caught in traffic this morning.');
});
});

1 change: 0 additions & 1 deletion client/src/app/notes/note.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ describe('Note service: ', () => {

expect(req.request.method).toEqual('GET');
expect(req.request.params.get('owner_id')).toEqual('588935f57546a2daea44de7c');
// expect(req.request.params.get('timestamp')).toEqual('new Date()');
req.flush(testNotes);
});

Expand Down
4 changes: 2 additions & 2 deletions client/src/app/owners/owner-doorboard.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ <h3>{{this.owner.name}}</h3>
<!--Each message is its own mat-card-->
<div fxFlex="column" class="list-of-notes">
<mat-card fxLayout="row wrap" class="note-card">
<mat-list-item>
<p matLine class="timestamp">{{note.timestamp}}</p>
<mat-list-item class = "note-list-item">
<p matLine class="message">{{note.message}}</p>
<p matLine class="timestamp">{{note.timestamp}}</p>
</mat-list-item>
</mat-card>
</div>
Expand Down

0 comments on commit 3338f10

Please sign in to comment.