diff --git a/backend/package.json b/backend/package.json
index b73efd2c7..be5fb086d 100644
--- a/backend/package.json
+++ b/backend/package.json
@@ -52,7 +52,7 @@
"cheerio": "~1.0.0-rc.3",
"cors": "~2.8.5",
"cross-env": "~5.2.0",
- "date-fns": "2.0.0-alpha.27",
+ "date-fns": "2.0.0-alpha.29",
"debug": "~4.1.1",
"dotenv": "~8.0.0",
"express": "~4.17.1",
diff --git a/backend/yarn.lock b/backend/yarn.lock
index 93192e865..9c8fdc3c5 100644
--- a/backend/yarn.lock
+++ b/backend/yarn.lock
@@ -2579,10 +2579,10 @@ data-urls@^1.0.0:
whatwg-mimetype "^2.2.0"
whatwg-url "^7.0.0"
-date-fns@2.0.0-alpha.27:
- version "2.0.0-alpha.27"
- resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.0.0-alpha.27.tgz#5ecd4204ef0e7064264039570f6e8afbc014481c"
- integrity sha512-cqfVLS+346P/Mpj2RpDrBv0P4p2zZhWWvfY5fuWrXNR/K38HaAGEkeOwb47hIpQP9Jr/TIxjZ2/sNMQwdXuGMg==
+date-fns@2.0.0-alpha.29:
+ version "2.0.0-alpha.29"
+ resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.0.0-alpha.29.tgz#9d4a36e3ebba63d009e957fea8fdfef7921bc6cb"
+ integrity sha512-AIFZ0hG/1fdb7HZHTDyiEJdNiaFyZxXcx/kF8z3I9wxbhkN678KrrLSneKcsb0Xy5KqCA4wCIxmGpdVWSNZnpA==
debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9:
version "2.6.9"
diff --git a/cypress/integration/common/profile.js b/cypress/integration/common/profile.js
index cb5689f63..1df1e2652 100644
--- a/cypress/integration/common/profile.js
+++ b/cypress/integration/common/profile.js
@@ -12,14 +12,16 @@ Then('I should be able to change my profile picture', () => {
cy.fixture(avatarUpload, 'base64').then(fileContent => {
cy.get('#customdropzone').upload(
{ fileContent, fileName: avatarUpload, mimeType: 'image/png' },
- { subjectType: 'drag-n-drop' },
+ { subjectType: 'drag-n-drop' }
)
})
- cy.get('#customdropzone')
- .should('have.attr', 'style')
+ cy.get('.profile-avatar img')
+ .should('have.attr', 'src')
.and('contains', 'onourjourney')
- cy.contains('.iziToast-message', 'Upload successful')
- .should('have.length', 1)
+ cy.contains('.iziToast-message', 'Upload successful').should(
+ 'have.length',
+ 1
+ )
})
When("I visit another user's profile page", () => {
@@ -31,4 +33,4 @@ Then('I cannot upload a picture', () => {
.children()
.should('not.have.id', 'customdropzone')
.should('have.class', 'ds-avatar')
-})
\ No newline at end of file
+})
diff --git a/cypress/integration/common/steps.js b/cypress/integration/common/steps.js
index 387f33ac0..8f5bcc8ea 100644
--- a/cypress/integration/common/steps.js
+++ b/cypress/integration/common/steps.js
@@ -230,7 +230,7 @@ When('I type in the following text:', text => {
Then('the post shows up on the landing page at position {int}', index => {
cy.openPage('landing')
- const selector = `:nth-child(${index}) > .ds-card > .ds-card-content`
+ const selector = `.post-card:nth-child(${index}) > .ds-card-content`
cy.get(selector).should('contain', lastPost.title)
cy.get(selector).should('contain', lastPost.content)
})
diff --git a/webapp/components/FilterMenu/FilterMenu.spec.js b/webapp/components/FilterMenu/FilterMenu.spec.js
new file mode 100644
index 000000000..c312a401b
--- /dev/null
+++ b/webapp/components/FilterMenu/FilterMenu.spec.js
@@ -0,0 +1,54 @@
+import { mount, createLocalVue } from '@vue/test-utils'
+import FilterMenu from './FilterMenu.vue'
+import Styleguide from '@human-connection/styleguide'
+
+const localVue = createLocalVue()
+
+localVue.use(Styleguide)
+
+describe('FilterMenu.vue', () => {
+ let wrapper
+ let mocks
+
+ const createWrapper = mountMethod => {
+ return mountMethod(FilterMenu, {
+ mocks,
+ localVue,
+ })
+ }
+
+ beforeEach(() => {
+ mocks = { $t: () => {} }
+ })
+
+ describe('mount', () => {
+ beforeEach(() => {
+ wrapper = createWrapper(mount)
+ })
+
+ it('renders a card', () => {
+ expect(wrapper.is('.ds-card')).toBe(true)
+ })
+
+ describe('click "filter-by-followed-authors-only" button', () => {
+ it('emits filterBubble object', () => {
+ wrapper.find({ name: 'filter-by-followed-authors-only' }).trigger('click')
+ expect(wrapper.emitted('changeFilterBubble')).toBeTruthy()
+ })
+
+ it('toggles filterBubble.author property', () => {
+ wrapper.find({ name: 'filter-by-followed-authors-only' }).trigger('click')
+ expect(wrapper.emitted('changeFilterBubble')[0]).toEqual([{ author: 'following' }])
+ wrapper.find({ name: 'filter-by-followed-authors-only' }).trigger('click')
+ expect(wrapper.emitted('changeFilterBubble')[1]).toEqual([{ author: 'all' }])
+ })
+
+ it('makes button primary', () => {
+ wrapper.find({ name: 'filter-by-followed-authors-only' }).trigger('click')
+ expect(
+ wrapper.find({ name: 'filter-by-followed-authors-only' }).classes('ds-button-primary'),
+ ).toBe(true)
+ })
+ })
+ })
+})
diff --git a/webapp/components/FilterMenu/FilterMenu.vue b/webapp/components/FilterMenu/FilterMenu.vue
new file mode 100644
index 000000000..a2195a5fd
--- /dev/null
+++ b/webapp/components/FilterMenu/FilterMenu.vue
@@ -0,0 +1,57 @@
+
+