Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
c0507d2
Create index.html
Tokle89 Aug 18, 2023
93fe7d4
installed bootstrap and scss
Tokle89 Aug 18, 2023
2835c12
created a variables.scss file
Tokle89 Aug 18, 2023
a99355e
linked bootstrap js
Tokle89 Aug 18, 2023
111cc37
Update _variables.scss
Tokle89 Aug 18, 2023
44f3647
added fonts, and adjusted color theme
Tokle89 Aug 22, 2023
58c0ae1
finished the header, and made the footer stay at the bottom
Tokle89 Aug 22, 2023
85f5d68
started on footer
Tokle89 Aug 23, 2023
10c074d
finished most of the home page
Tokle89 Aug 23, 2023
ad321ac
small adjustment
Tokle89 Aug 23, 2023
b51d52a
finished home page and almost finished with feed
Tokle89 Aug 24, 2023
528900a
finished feed page
Tokle89 Aug 28, 2023
3a0a143
finished profile page
Tokle89 Aug 28, 2023
f47070b
finished styling
Tokle89 Aug 29, 2023
872889a
changed name on file
Tokle89 Aug 29, 2023
7ee1603
Update styles.scss
Tokle89 Aug 29, 2023
08e9958
changed form styling for login
Tokle89 Aug 29, 2023
92b817b
changed background colors
Tokle89 Aug 29, 2023
cb155e5
updated variables
Tokle89 Aug 29, 2023
b064362
cleaned up the styles.scss into sever files
Tokle89 Aug 30, 2023
7b804e8
spilt styles.scss rules into several files
Tokle89 Aug 30, 2023
96e3419
updated the href in links
Tokle89 Aug 30, 2023
488dd05
Update README.md
Tokle89 Aug 30, 2023
f5969e7
Update README.md
Tokle89 Aug 30, 2023
c765f14
Merge pull request #1 from Tokle89/css-frameworks
Tokle89 Aug 30, 2023
52fbb44
Update index.html
Tokle89 Aug 31, 2023
0764106
updated js script
Tokle89 Aug 31, 2023
f4ea63f
switched from flex to grid for the about section
Tokle89 Aug 31, 2023
36b61dd
changed from flex to grid in log in section
Tokle89 Aug 31, 2023
c3f4192
Update index.scss
Tokle89 Aug 31, 2023
22f4e31
Update index.html
Tokle89 Aug 31, 2023
1d8d569
Update index.html
Tokle89 Aug 31, 2023
662d58f
Create index.js
Tokle89 Sep 17, 2023
9713709
created api function for site
Tokle89 Sep 18, 2023
c4d94d1
created event listener for registrer
Tokle89 Sep 18, 2023
172f5f6
finished creating a registrer function
Tokle89 Sep 18, 2023
a5b37f2
registrer function modal in progress
Tokle89 Sep 18, 2023
2215947
updated if statement in api call
Tokle89 Sep 18, 2023
6dfa4f3
completed register functionality
Tokle89 Sep 19, 2023
04451e0
finished register and login functionality
Tokle89 Sep 19, 2023
5d8154e
created a profile page for user
Tokle89 Sep 20, 2023
06b1346
added number value to feed btns
Tokle89 Sep 23, 2023
9191033
started rendering posts
Tokle89 Sep 23, 2023
59f4f81
fixed naming conventions
Tokle89 Sep 25, 2023
2ab9ccd
finished fething posts, working on comments
Tokle89 Sep 25, 2023
941bee8
working on comments
Tokle89 Sep 26, 2023
ee643be
started on submiting post funcition
Tokle89 Sep 27, 2023
6581c61
Update _feed.scss
Tokle89 Sep 27, 2023
63d3922
finished creating, and deleting posts
Tokle89 Oct 1, 2023
669cd0c
finishing feed page
Tokle89 Oct 3, 2023
8553f4d
finished view specific post id
Tokle89 Oct 3, 2023
84f951c
finished filter function. started search function
Tokle89 Oct 4, 2023
27526d6
finished search funciton
Tokle89 Oct 5, 2023
88e0761
finished dynamic profile feed
Tokle89 Oct 6, 2023
1a264a6
toggle feed function
Tokle89 Oct 6, 2023
e49b5c7
cleaning up code
Tokle89 Oct 7, 2023
d072378
cleaaned up feed.js and change function map to utils map
Tokle89 Oct 7, 2023
01f0f20
fixing code
Tokle89 Oct 7, 2023
3fe85f0
cleaned up code
Tokle89 Oct 9, 2023
b732e25
cleaned up files
Tokle89 Oct 9, 2023
49adaf2
cleaned up code
Tokle89 Oct 10, 2023
03fdab8
removed files
Tokle89 Oct 10, 2023
90479e9
cleaned up code
Tokle89 Oct 12, 2023
d112316
made function that checks if user has logged in
Tokle89 Oct 12, 2023
c72d062
finished submit avatar funciton
Tokle89 Oct 13, 2023
3fa900c
started documenting the code
Tokle89 Oct 13, 2023
cbac817
finished commenting on code
Tokle89 Oct 14, 2023
dc61ce9
deployed dist
Tokle89 Oct 14, 2023
17c2878
Update index.html
Tokle89 Oct 14, 2023
121d052
removed log in section if user is logged in
Tokle89 Oct 14, 2023
5debaa2
installs and configures jest
Tokle89 Oct 25, 2023
10f994a
installs and configures babel for jest
Tokle89 Oct 25, 2023
9f33688
0.0.2
Tokle89 Oct 25, 2023
40009cb
updates package.json
Tokle89 Oct 26, 2023
541c04f
installs and configures cypress
Tokle89 Oct 26, 2023
cef5635
creates script for cypress
Tokle89 Oct 26, 2023
373ef8a
1.0.0
Tokle89 Oct 26, 2023
a6c1dd1
installed cypriss and create scripts
Tokle89 Oct 26, 2023
0db7a79
create login error test for app
Tokle89 Oct 26, 2023
63bee07
creates login test
Tokle89 Oct 27, 2023
bb775dc
ok
Tokle89 May 30, 2024
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
24 changes: 24 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": "eslint:recommended",
"overrides": [
{
"files": ["**/*.cy.js"],
"env": { "cypress/globals": true },
"plugins": ["cypress"],
"extends": ["plugin:cypress/recommended"],
"rules": {
"cypress/no-unnecessary-waiting": "off",
"no-unused-vars": "off"
}
}
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
}
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
node_modules/
.DS_Store
dist/

41 changes: 39 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,39 @@
# css-frameworks-ca
Replace this text with a description of your social media project.
## css-frameworks-ca
![Friendly](https://github.com/Tokle89/css-frameworks/assets/94007467/216af4e8-93c7-4f9f-9292-b2401af816e7)
Was asked to create a social media site using bootstrap and scss to show knowledge in using the framework.

Site architecture:

- Home page
- Feed
- Profile

## Built with

-Html

- Bootstrap / Scss

### Installing

1. Clone the repo:

```bash
git clone https://github.com/Tokle89/healthy-life
```

### Running

To run the app, run the following commands:

```bash
npm run start
```

## Contribution

If you would like to contribute to my project - Just make a pull request and push your changes

## Contact

[My LinkedIn page](https://www.linkedin.com/in/fredrik-tokle-0994a023b/)
3 changes: 3 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": [["@babel/preset-env", { "targets": { "node": "current" } }]]
}
9 changes: 9 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const { defineConfig } = require("cypress");

module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
},
});
143 changes: 143 additions & 0 deletions cypress/e2e/1-getting-started/todo.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
/// <reference types="cypress" />

// Welcome to Cypress!
//
// This spec file contains a variety of sample tests
// for a todo list app that are designed to demonstrate
// the power of writing tests in Cypress.
//
// To learn more about how Cypress works and
// what makes it such an awesome testing tool,
// please read our getting started guide:
// https://on.cypress.io/introduction-to-cypress

describe('example to-do app', () => {
beforeEach(() => {
// Cypress starts out with a blank slate for each test
// so we must tell it to visit our website with the `cy.visit()` command.
// Since we want to visit the same URL at the start of all our tests,
// we include it in our beforeEach function so that it runs before each test
cy.visit('https://example.cypress.io/todo')
})

it('displays two todo items by default', () => {
// We use the `cy.get()` command to get all elements that match the selector.
// Then, we use `should` to assert that there are two matched items,
// which are the two default items.
cy.get('.todo-list li').should('have.length', 2)

// We can go even further and check that the default todos each contain
// the correct text. We use the `first` and `last` functions
// to get just the first and last matched elements individually,
// and then perform an assertion with `should`.
cy.get('.todo-list li').first().should('have.text', 'Pay electric bill')
cy.get('.todo-list li').last().should('have.text', 'Walk the dog')
})

it('can add new todo items', () => {
// We'll store our item text in a variable so we can reuse it
const newItem = 'Feed the cat'

// Let's get the input element and use the `type` command to
// input our new list item. After typing the content of our item,
// we need to type the enter key as well in order to submit the input.
// This input has a data-test attribute so we'll use that to select the
// element in accordance with best practices:
// https://on.cypress.io/selecting-elements
cy.get('[data-test=new-todo]').type(`${newItem}{enter}`)

// Now that we've typed our new item, let's check that it actually was added to the list.
// Since it's the newest item, it should exist as the last element in the list.
// In addition, with the two default items, we should have a total of 3 elements in the list.
// Since assertions yield the element that was asserted on,
// we can chain both of these assertions together into a single statement.
cy.get('.todo-list li')
.should('have.length', 3)
.last()
.should('have.text', newItem)
})

it('can check off an item as completed', () => {
// In addition to using the `get` command to get an element by selector,
// we can also use the `contains` command to get an element by its contents.
// However, this will yield the <label>, which is lowest-level element that contains the text.
// In order to check the item, we'll find the <input> element for this <label>
// by traversing up the dom to the parent element. From there, we can `find`
// the child checkbox <input> element and use the `check` command to check it.
cy.contains('Pay electric bill')
.parent()
.find('input[type=checkbox]')
.check()

// Now that we've checked the button, we can go ahead and make sure
// that the list element is now marked as completed.
// Again we'll use `contains` to find the <label> element and then use the `parents` command
// to traverse multiple levels up the dom until we find the corresponding <li> element.
// Once we get that element, we can assert that it has the completed class.
cy.contains('Pay electric bill')
.parents('li')
.should('have.class', 'completed')
})

context('with a checked task', () => {
beforeEach(() => {
// We'll take the command we used above to check off an element
// Since we want to perform multiple tests that start with checking
// one element, we put it in the beforeEach hook
// so that it runs at the start of every test.
cy.contains('Pay electric bill')
.parent()
.find('input[type=checkbox]')
.check()
})

it('can filter for uncompleted tasks', () => {
// We'll click on the "active" button in order to
// display only incomplete items
cy.contains('Active').click()

// After filtering, we can assert that there is only the one
// incomplete item in the list.
cy.get('.todo-list li')
.should('have.length', 1)
.first()
.should('have.text', 'Walk the dog')

// For good measure, let's also assert that the task we checked off
// does not exist on the page.
cy.contains('Pay electric bill').should('not.exist')
})

it('can filter for completed tasks', () => {
// We can perform similar steps as the test above to ensure
// that only completed tasks are shown
cy.contains('Completed').click()

cy.get('.todo-list li')
.should('have.length', 1)
.first()
.should('have.text', 'Pay electric bill')

cy.contains('Walk the dog').should('not.exist')
})

it('can delete all completed tasks', () => {
// First, let's click the "Clear completed" button
// `contains` is actually serving two purposes here.
// First, it's ensuring that the button exists within the dom.
// This button only appears when at least one task is checked
// so this command is implicitly verifying that it does exist.
// Second, it selects the button so we can click it.
cy.contains('Clear completed').click()

// Then we can make sure that there is only one element
// in the list and our element does not exist
cy.get('.todo-list li')
.should('have.length', 1)
.should('not.have.text', 'Pay electric bill')

// Finally, make sure that the clear button no longer exists.
cy.contains('Clear completed').should('not.exist')
})
})
})
Loading