Skip to content

Commit

Permalink
ft(user-can-rate-artilce)
Browse files Browse the repository at this point in the history
add a temporary login form
add a temporary get all articles page
add read one article page
add a dropdown button
add the star rating  modal
add the an on-success notification
[Starts #166840975]
  • Loading branch information
Alpha1202 committed Aug 7, 2019
1 parent f4f36d1 commit c488b6c
Show file tree
Hide file tree
Showing 24 changed files with 1,067 additions and 115 deletions.
2 changes: 1 addition & 1 deletion _test_/App.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ describe('App', () => {
expect(app.find('Switch').length).toBe(1);
});
it('renders a Route component', () => {
expect(app.find('Route').length).toBe(3);
expect(app.find('Route').length).toBe(5);
});
});
24 changes: 24 additions & 0 deletions _test_/Articles.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react';
import expect from 'expect';
import { shallow } from 'enzyme';

import Articles from '../src/views/Articles/Articles';

describe('App', () => {
let app;
beforeEach(() => {
app = shallow(<Articles />);
});

it('renders successfully', () => {
expect(app).toBeDefined();
});

it('renders a div component', () => {
expect(app.find('div').length).toBe(1);
});

it('tags have classes', () => {
expect(app.find('_class').length).toBe(35);
});
});
24 changes: 24 additions & 0 deletions _test_/Card.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react';
import expect from 'expect';
import { shallow, mount } from 'enzyme';

import Card from '../src/components/Card';


describe('App', () => {
let app;
beforeEach(() => {
app = shallow(<Card />);
});

it('renders successfully', () => {
expect(app).toBeDefined();
});
it('renders a div component', () => {
expect(app.find('div').length).toBe(1);
});

it('renders classNames component', () => {
expect(app.find('_class').length).toBe(7);
});
});
18 changes: 18 additions & 0 deletions _test_/Dropdown.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';
import expect from 'expect';
import { shallow } from 'enzyme';

import Dropdown from '../src/components/Dropdown';


describe('App', () => {
let app;
beforeEach(() => {
app = shallow(<Dropdown />);
});

it('renders successfully', () => {
expect(app).toBeDefined();
});

});
6 changes: 3 additions & 3 deletions _test_/Homepage.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ describe('App', () => {
expect(app.find('ul').length).toBe(1);
});
it('renders a li component', () => {
expect(app.find('li').length).toBe(2);
expect(app.find('li').length).toBe(3);
});
it('renders a br component', () => {
expect(app.find('br').length).toBe(2);
expect(app.find('br').length).toBe(4);
});
it('renders a Link component', () => {
expect(app.find('Link').length).toBe(2);
expect(app.find('Link').length).toBe(3);
});
});
22 changes: 0 additions & 22 deletions _test_/Login.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,4 @@ describe('App', () => {
it('renders successfully', () => {
expect(app).toBeDefined();
});

it('renders a div component', () => {
expect(app.find('div').length).toBe(1);
});

it('renders a h1 component', () => {
expect(app.find('h1').length).toBe(1);
});

it('renders a h3 component', () => {
expect(app.find('h3').length).toBe(1);
});

it('renders a ul component', () => {
expect(app.find('ul').length).toBe(1);
});
it('renders a li component', () => {
expect(app.find('li').length).toBe(1);
});
it('renders a Link component', () => {
expect(app.find('Link').length).toBe(1);
});
});
41 changes: 41 additions & 0 deletions _test_/RatingsModal.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React from 'react';
import expect from 'expect';
import { shallow } from 'enzyme';

import RatingsModal from '../src/components/RatingsModal';


describe('App', () => {
let app;
beforeEach(() => {
app = shallow(<RatingsModal />);
});

it('renders successfully', () => {
expect(app).toBeDefined();
console.log(app.debug())
});

it('tags have classes', () => {
expect(app.find('_class').length).toBe(9);
});

it('renders a span tag', () => {
expect(app.find('span').length).toBe(1);
});

it('renders a div', () => {
expect(app.find('div').length).toBe(1);
});

it('renders a h2 tag', () => {
expect(app.find('h2').length).toBe(1);
});

it('renders StarRatingComponent', () => {
expect(app.find('StarRatingComponent').length).toBe(1);
});
});



16 changes: 16 additions & 0 deletions _test_/ReadArticle.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react';
import expect from 'expect';
import { shallow } from 'enzyme';

import ReadArticles from '../src/views/Articles/ReadArticle';

describe('App', () => {
let app;
beforeEach(() => {
app = shallow(<ReadArticles />);
});

it('renders successfully', () => {
expect(app).toBeDefined();
});
});
Loading

0 comments on commit c488b6c

Please sign in to comment.