This repository has been archived by the owner on Oct 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 #2602 from withspectrum/2.1.9
2.1.9
- Loading branch information
Showing
81 changed files
with
4,152 additions
and
975 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
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,15 @@ | ||
<!-- | ||
FILL OUT THE FORM BELOW OR THE ISSUE WILL BE AUTO-CLOSED | ||
**Issue Type (check one)** | ||
- [ ] Bug Report | ||
- [ ] Feature Idea | ||
- [ ] Technical Discussion | ||
- [ ] Question (these will be auto-closed, please ask them on Spectrum instead https://spectrum.chat/spectrum/open) | ||
--> | ||
|
||
**Description (type any text below)** | ||
|
||
|
||
|
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,25 +1,22 @@ | ||
### Deploy after merge (delete what needn't be deployed) | ||
- iris | ||
- hyperion | ||
<!-- FILL OUT THE BELOW FORM OR YOUR PR WILL BE AUTOMATICALLY CLOSED --> | ||
**Status** | ||
- [ ] WIP | ||
- [ ] Ready for review | ||
- [ ] Needs testing | ||
|
||
**Deploy after merge (delete what needn't be deployed)** | ||
- iris (api) | ||
- hyperion (frontend) | ||
- athena | ||
- vulcan | ||
- mercury | ||
- hermes | ||
- chronos | ||
- mobile | ||
|
||
### Run database migrations (delete if not) | ||
**Run database migrations (delete if no migration was added)** | ||
YES | ||
|
||
## Release notes | ||
**Release notes for users (delete if codebase-only change)** | ||
- | ||
|
||
<!-- | ||
### Labels | ||
Please check the checkboxes below for any labels you want assigned to the PR: | ||
- [ ] WIP | ||
- [ ] Ready for review | ||
- [ ] Needs testing | ||
--> |
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,4 @@ | ||
{ | ||
"baseUrl": "http://localhost:3000", | ||
"viewportWidth": 1300 | ||
} |
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,5 @@ | ||
{ | ||
"name": "Using fixtures to represent data", | ||
"email": "[email protected]", | ||
"body": "Fixtures are a great way to mock data for responses to routes" | ||
} |
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,24 @@ | ||
import data from '../../shared/testing/data'; | ||
|
||
const channel = data.channels[0]; | ||
const community = data.communities.find( | ||
community => community.id === channel.communityId | ||
); | ||
|
||
describe('Channel View', () => { | ||
// Before every test suite set up a new browser and page | ||
before(() => { | ||
cy.visit(`/${community.slug}/${channel.slug}`); | ||
}); | ||
|
||
it('should render', () => { | ||
cy.get('[data-e2e-id="channel-view"]').should('be.visible'); | ||
cy.contains(channel.description); | ||
cy.contains(channel.name); | ||
data.threads | ||
.filter(thread => thread.channelId === channel.id) | ||
.forEach(thread => { | ||
cy.contains(thread.content.title); | ||
}); | ||
}); | ||
}); |
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,33 @@ | ||
import data from '../../shared/testing/data'; | ||
|
||
const community = data.communities[0]; | ||
|
||
describe('Community View', () => { | ||
beforeEach(() => { | ||
cy.visit(`/${community.slug}`); | ||
}); | ||
|
||
it('should render all the communities data, and show a list of channels and threads', () => { | ||
cy.get('[data-e2e-id="community-view"]').should('be.visible'); | ||
cy.contains(community.description); | ||
cy.contains(community.name); | ||
cy.contains(community.website); | ||
cy.get(`[src*="${community.profilePhoto}"]`).should('be.visible'); | ||
// TODO: Actually use a Cypress API for this instead of this hacky shit | ||
cy.document().then(document => { | ||
expect(document.body.toString().indexOf(community.coverPhoto) > -1); | ||
}); | ||
|
||
data.threads | ||
.filter(thread => thread.communityId === community.id) | ||
.forEach(thread => { | ||
cy.contains(thread.content.title).should('be.visible'); | ||
}); | ||
|
||
data.channels | ||
.filter(channel => channel.communityId === community.id) | ||
.forEach(channel => { | ||
cy.contains(channel.name).should('be.visible'); | ||
}); | ||
}); | ||
}); |
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,32 @@ | ||
import data from '../../shared/testing/data'; | ||
|
||
const user = data.users[0]; | ||
const channelIds = data.usersChannels | ||
.filter(({ userId }) => userId === user.id) | ||
.map(({ channelId }) => channelId); | ||
const dashboardThreads = data.threads.filter(({ channelId }) => | ||
channelIds.includes(channelId) | ||
); | ||
|
||
describe('Inbox View', () => { | ||
before(() => { | ||
cy.auth(user.id); | ||
cy.visit('/'); | ||
}); | ||
|
||
it('should render the inbox view', () => { | ||
cy.get('[data-e2e-id="inbox-view"]').should('be.visible'); | ||
dashboardThreads.forEach(thread => { | ||
cy.contains(thread.content.title); | ||
}); | ||
const usersCommunities = data.usersCommunities | ||
.filter(({ userId }) => user.id === userId) | ||
.map(({ communityId }) => | ||
data.communities.find(({ id }) => id === communityId) | ||
); | ||
usersCommunities.forEach(community => { | ||
cy.contains(community.name); | ||
}); | ||
cy.get('[data-e2e-id="thread-view"]').should('be.visible'); | ||
}); | ||
}); |
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,15 @@ | ||
describe('Login View', () => { | ||
beforeEach(() => { | ||
cy.visit('/login'); | ||
}); | ||
|
||
it('should render', () => { | ||
cy.get('[data-e2e-id="login-page"]').should('be.visible'); | ||
cy.get('[href*="/auth/twitter"]').should('be.visible'); | ||
cy.get('[href*="/auth/facebook"]').should('be.visible'); | ||
cy.get('[href*="/auth/google"]').should('be.visible'); | ||
cy | ||
.get('[href*="github.com/withspectrum/code-of-conduct"]') | ||
.should('be.visible'); | ||
}); | ||
}); |
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,11 @@ | ||
describe('Splash View', () => { | ||
before(() => { | ||
cy.visit('/'); | ||
}); | ||
|
||
it('should render the splash page', () => { | ||
cy.get('[data-e2e-id="splash-page"]').should('be.visible'); | ||
cy.get('[href*="/login"]').should('be.visible'); | ||
cy.get('[href*="/new/community"]').should('be.visible'); | ||
}); | ||
}); |
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,36 @@ | ||
import { toPlainText, toState } from '../../shared/draft-utils'; | ||
import data from '../../shared/testing/data'; | ||
|
||
const thread = data.threads[0]; | ||
const channel = data.channels.find(channel => channel.id === thread.channelId); | ||
const community = data.communities.find( | ||
community => community.id === thread.communityId | ||
); | ||
const author = data.users.find(user => user.id === thread.creatorId); | ||
const messages = data.messages.filter( | ||
message => message.threadId === thread.id | ||
); | ||
|
||
describe('Thread View', () => { | ||
// Before every test suite set up a new browser and page | ||
before(() => { | ||
cy.visit(`/thread/${thread.id}`); | ||
}); | ||
|
||
it('should render', () => { | ||
cy.get('[data-e2e-id="thread-view"]').should('be.visible'); | ||
cy.contains(thread.content.title); | ||
cy.contains( | ||
toPlainText(toState(JSON.parse(thread.content.body))).split(' ')[0] | ||
); | ||
cy.contains(author.name); | ||
cy.contains(author.username); | ||
cy.get(`[href*="/users/${author.username}"]`).should('be.visible'); | ||
cy.get(`[href*="/${community.slug}"]`).should('be.visible'); | ||
|
||
cy.get('[data-e2e-id="message-group"]').should('be.visible'); | ||
messages.forEach(message => { | ||
cy.contains(toPlainText(toState(JSON.parse(message.content.body)))); | ||
}); | ||
}); | ||
}); |
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,40 @@ | ||
import data from '../../shared/testing/data'; | ||
|
||
const user = data.users[0]; | ||
|
||
describe('User View', () => { | ||
before(() => { | ||
cy.visit(`/users/${user.username}`); | ||
}); | ||
|
||
it('should render', () => { | ||
cy.get('[data-e2e-id="user-view"]').should('be.visible'); | ||
cy.contains(user.username); | ||
cy.contains(user.name); | ||
cy.contains(user.description); | ||
cy.contains(user.website); | ||
cy.get('[data-e2e-id="thread-feed"]').should('be.visible'); | ||
data.threads | ||
.filter(thread => thread.creatorId === user.id) | ||
.forEach(thread => { | ||
cy.contains(thread.content.title); | ||
}); | ||
}); | ||
|
||
it('should list the communities a user is a member of, including their rep in that community', () => { | ||
const usersCommunities = data.usersCommunities.filter( | ||
({ userId }) => userId === user.id | ||
); | ||
const communityIds = usersCommunities.map(({ communityId }) => communityId); | ||
const communities = data.communities.filter(({ id }) => | ||
communityIds.includes(id) | ||
); | ||
communities.forEach(community => { | ||
cy.contains(community.name); | ||
const userCommunity = usersCommunities.find( | ||
({ communityId }) => communityId === community.id | ||
); | ||
cy.contains(userCommunity.reputation); | ||
}); | ||
}); | ||
}); |
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,17 @@ | ||
// *********************************************************** | ||
// This example plugins/index.js can be used to load plugins | ||
// | ||
// You can change the location of this file or turn off loading | ||
// the plugins file with the 'pluginsFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/plugins-guide | ||
// *********************************************************** | ||
|
||
// This function is called when a project is opened or re-opened (e.g. due to | ||
// the project's config changing) | ||
|
||
module.exports = (on, config) => { | ||
// `on` is used to hook into various events Cypress emits | ||
// `config` is the resolved Cypress config | ||
}; |
Oops, something went wrong.