-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from UMM-CSci-3601-S20/refactorPostComponents
Refactor post components
- Loading branch information
Showing
27 changed files
with
255 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import {browser, protractor, by, element, utils} from 'protractor'; | ||
import { AddNotePage, TestNote } from './add-note.po'; | ||
import { E2EUtil } from './e2e.util'; | ||
|
||
describe('Add note', () => { | ||
let page: AddNotePage; | ||
const EC = protractor.ExpectedConditions; | ||
|
||
beforeEach(() => { | ||
page = new AddNotePage(); | ||
page.navigateTo(); | ||
}); | ||
|
||
it('Should have the correct title', () => { | ||
expect(page.getTitle()).toEqual('New Note'); | ||
}); | ||
|
||
|
||
it('Should enable and disable the add note button', async () => { | ||
expect(element(by.buttonText('ADD NOTE')).isEnabled()).toBe(false); | ||
await page.typeInput('messageField', 'bit.ly/umm-cscc'); | ||
expect(element(by.buttonText('ADD NOTE')).isEnabled()).toBe(true); | ||
}); | ||
|
||
it('Should add a new note and go to the right page', async () => { | ||
const note: TestNote = { | ||
owner_id: E2EUtil.randomText(14), | ||
message: E2EUtil.randomLetters(10), | ||
owner: E2EUtil.randomText(10), | ||
}; | ||
|
||
await page.addNote(note); | ||
|
||
// Wait until the URL does not contain 'notes/new | ||
await browser.wait(EC.not(EC.urlContains('notes/new')), 10000); | ||
|
||
const url = await page.getUrl(); | ||
expect(RegExp('/owner/78f1d3bfa098879fe7a01373/notes').test(url)).toBe(true); | ||
expect(url.endsWith('/notes/new')).toBe(false); | ||
}); | ||
|
||
}); | ||
|
||
/// Tried lots of things and nothing worked. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletions
16
client/src/app/posts/add-post.component.html → client/src/app/notes/add-note.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
client/src/app/posts/add-post.component.scss → client/src/app/notes/add-note.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
.add-post-title { | ||
.add-note-title { | ||
font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.