Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.

2.1.9 #2602

Merged
merged 70 commits into from
Mar 19, 2018
Merged

2.1.9 #2602

Show file tree
Hide file tree
Changes from 64 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
29a09c5
Run all tests on CircleCI
mxstbr Feb 22, 2018
e60b282
Should actually run the job eh
mxstbr Feb 22, 2018
f416691
Maybe fix config
mxstbr Feb 22, 2018
b055b83
Fix stuff
mxstbr Feb 22, 2018
823c744
Cleanup based on Mikes comments
mxstbr Feb 23, 2018
711b9d1
Remove failing command
mxstbr Feb 23, 2018
209155a
Sleep after starting RDB
mxstbr Feb 23, 2018
f2bf5c1
Start Redis?
mxstbr Feb 23, 2018
739433d
Fix puppeteer on Circle
mxstbr Feb 23, 2018
4eeefcd
Share puppeteer config
mxstbr Feb 23, 2018
883bfab
Add comment
mxstbr Feb 28, 2018
8cb04f8
Update upload client and server versions
brianlovin Mar 14, 2018
23fb621
Add and upgrade packages to help with uploading
brianlovin Mar 14, 2018
959be59
Refactor iris uploading
brianlovin Mar 14, 2018
43aa147
Tweaks in sendMessage mutation
brianlovin Mar 14, 2018
7232561
Refactored media upload component
brianlovin Mar 14, 2018
ad0dfec
Refactor frontend media upload component
brianlovin Mar 14, 2018
4e495b2
Swap file types to upload types
brianlovin Mar 14, 2018
d163481
Fix image uploading everywhere else
brianlovin Mar 14, 2018
d01b007
Switch to using the AWS SDK directly for image uploads
mxstbr Mar 15, 2018
ada7152
Fixies
mxstbr Mar 15, 2018
990c3db
Add libdef for aws-sdk
mxstbr Mar 15, 2018
7cbc914
Dont show optimistic media messages, show spinner while uploading
brianlovin Mar 15, 2018
400686a
Merge branch 'alpha' of https://github.com/withspectrum/spectrum into…
brianlovin Mar 15, 2018
9a80e0c
Merge pull request #2580 from withspectrum/upgrade-image-uploads
brianlovin Mar 15, 2018
1a5f401
Merge branch 'alpha' into run-tests-on-circle
mxstbr Mar 16, 2018
d7d74b8
Add eslint running
mxstbr Mar 16, 2018
11f02b1
Move e2e tests to cypress
mxstbr Mar 16, 2018
e62758b
Add custom cypress.auth command
mxstbr Mar 16, 2018
080fa77
Run Cypress E2E tests on Cirlce
mxstbr Mar 16, 2018
c2cef99
Add cypress folder to danger blacklist
mxstbr Mar 16, 2018
393b3ae
Run Danger on Circle
mxstbr Mar 16, 2018
97aacdd
Add channelSettings table migration
brianlovin Mar 16, 2018
0d64268
Add mutation to join private channel with a token
brianlovin Mar 16, 2018
2dfbf23
Add client routes to join a channel with a token
brianlovin Mar 16, 2018
2a02e71
Handle scenarios where user is already pending in channel
brianlovin Mar 16, 2018
5ee6051
Add channelSettings loader
brianlovin Mar 16, 2018
6530b75
Add channelSettings db models
brianlovin Mar 16, 2018
805f084
Add typing to graphQL for new mutations and queries
brianlovin Mar 16, 2018
c3fd0a8
Lint fix
brianlovin Mar 16, 2018
bf2276c
Add client side controls for token based joining in private channels
brianlovin Mar 16, 2018
2cd2075
Add mutations to enable, disable, and reset token based joining
brianlovin Mar 16, 2018
abb788d
Add proper joinSettings query resolver on channel
brianlovin Mar 16, 2018
f4f1dfb
Adds api mutations to enable, disable, and reset token based joining …
brianlovin Mar 16, 2018
e063229
Fix setting checks when joining a channel via token
brianlovin Mar 16, 2018
1842c52
Remove console log
brianlovin Mar 16, 2018
00c12a7
Ignore migration files in danger flow
brianlovin Mar 17, 2018
e26ed64
Code cleanup
mxstbr Mar 17, 2018
97b60cc
Update testing docs
mxstbr Mar 17, 2018
f8769fc
Update PR template, add issue template
mxstbr Mar 17, 2018
a8a3c15
Fix breakage due to loader caching
brianlovin Mar 17, 2018
55ed20f
Remove console
brianlovin Mar 17, 2018
45fe12d
Add a test for fetching channel settings
brianlovin Mar 17, 2018
12b640c
Add snapshot
brianlovin Mar 18, 2018
94f1a56
eslint
brianlovin Mar 18, 2018
d6df692
Merge pull request #2593 from withspectrum/cypress
brianlovin Mar 18, 2018
c3d94c8
Merge branch 'alpha' into join-private-channel-with-token
brianlovin Mar 18, 2018
07bd545
Merge pull request #2596 from withspectrum/templates
mxstbr Mar 19, 2018
f3dbc3a
Upgrade draft-js-plugin-no-console
mxstbr Mar 19, 2018
767d4f3
Merge pull request #2599 from withspectrum/fix-danger
mxstbr Mar 19, 2018
a534cb8
Merge branch 'alpha' into join-private-channel-with-token
mxstbr Mar 19, 2018
0e5b238
Run CircleCI jobs in parallel
mxstbr Mar 19, 2018
9eb9efb
Fix attaching workspace
mxstbr Mar 19, 2018
911eb25
Merge pull request #2594 from withspectrum/join-private-channel-with-…
brianlovin Mar 19, 2018
139ba46
Merge branch 'alpha' of https://github.com/withspectrum/spectrum into…
brianlovin Mar 19, 2018
078a033
Version number
brianlovin Mar 19, 2018
7eb29f8
Small fixes to help danger pass 2.1.9
brianlovin Mar 19, 2018
c27d54b
Merge pull request #2600 from withspectrum/clean-up-circle
mxstbr Mar 19, 2018
29ebd11
Merge pull request #2603 from withspectrum/fix-219-bugs
mxstbr Mar 19, 2018
76fbe0f
Merge branch 'alpha' of https://github.com/withspectrum/spectrum into…
brianlovin Mar 19, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,65 @@ jobs:
at: ~/spectrum
- run: cd ./mobile && yarn test:unit

# Test the web JS
test_web_js:
<<: *defaults
docker:
- image: circleci/node:8-browsers
- image: redis:3.2.7
- image: cypress/base:6
environment:
TERM: xterm
steps:
- attach_workspace:
at: ~/spectrum
- run:
name: Install RethinkDB 2.3.5
command:
|
echo "deb http://download.rethinkdb.com/apt jessie main" | sudo tee /etc/apt/sources.list.d/rethinkdb.list
wget -qO- http://download.rethinkdb.com/apt/pubkey.gpg | sudo apt-key add -
sudo apt-get update
sudo apt-get install rethinkdb=2.3.5~0jessie
- run:
name: Start RethinkDB
command: rethinkdb --bind all
background: true
- run: sleep 10
- run:
name: Setup and build
command:
|
node -e "const setup = require('./shared/testing/setup.js')().then(() => process.exit())"
yarn run build:web
yarn run build:iris
- run:
name: Start Iris in the background
command: TEST_DB=true yarn run dev:iris
background: true
- run:
name: Start web client in the background
command: yarn run dev:web
background: true
- run: sleep 60
- run:
name: Run Flow
command: yarn run flow
- run:
name: Run ESLint
command: yarn run lint
- run:
name: Run Unit Tests
command: yarn run test:ci
- run:
name: Run E2E Tests
command: yarn run test:e2e
- run:
name: Danger
when: always
command: yarn run danger ci


# Tests native code of the mobile app
test_mobile_native:
<<: *macos_defaults
Expand Down Expand Up @@ -100,3 +159,11 @@ workflows:
# - test_mobile_native:
# requires:
# - checkout_environment

# Tests web app
test_web:
jobs:
- checkout_environment
- test_web_js:
requires:
- checkout_environment
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE.md
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)**



27 changes: 12 additions & 15 deletions .github/PULL_REQUEST_TEMPLATE.md
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

-->
4 changes: 4 additions & 0 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"baseUrl": "http://localhost:3000",
"viewportWidth": 1300
}
5 changes: 5 additions & 0 deletions cypress/fixtures/example.json
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"
}
24 changes: 24 additions & 0 deletions cypress/integration/channel_spec.js
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);
});
});
});
33 changes: 33 additions & 0 deletions cypress/integration/community_spec.js
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');
});
});
});
32 changes: 32 additions & 0 deletions cypress/integration/inbox_spec.js
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');
});
});
15 changes: 15 additions & 0 deletions cypress/integration/login_spec.js
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');
});
});
11 changes: 11 additions & 0 deletions cypress/integration/splash_spec.js
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');
});
});
36 changes: 36 additions & 0 deletions cypress/integration/thread_spec.js
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))));
});
});
});
40 changes: 40 additions & 0 deletions cypress/integration/user_spec.js
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);
});
});
});
17 changes: 17 additions & 0 deletions cypress/plugins/index.js
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
};
21 changes: 21 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
import { encode } from '../../iris/utils/base64';

Cypress.Commands.add('auth', userId => {
cy.setCookie(
'session',
encode(JSON.stringify({ passport: { user: userId } })),
{
httpOnly: true,
secure: false,
}
);
});
Loading