File tree Expand file tree Collapse file tree 9 files changed +128
-15
lines changed Expand file tree Collapse file tree 9 files changed +128
-15
lines changed Original file line number Diff line number Diff line change
1
+ name : build-next
2
+ on :
3
+ push :
4
+ branches : [ develop ]
5
+ pull_request :
6
+ branches : [ develop ]
7
+ jobs :
8
+ build :
9
+ runs-on : ubuntu-latest
10
+ strategy :
11
+ max-parallel : 24
12
+ matrix :
13
+ node-version : [14.x, 16.x]
14
+ steps :
15
+ - uses : actions/checkout@v2
16
+ - name : Use Node.js ${{ matrix.node-version }} 🪢
17
+ uses : actions/setup-node@v1
18
+ with :
19
+ node-version : ${{ matrix.node-version }}
20
+ - name : Install dependencies 📦
21
+ run : npm install && npm run bootstrap
22
+ - name : Run lint and component tests 🧪
23
+ uses : cypress-io/github-action@v2
24
+ with :
25
+ command : npm run test:oruga-next
26
+ - name : Upload coverage 📈
27
+ uses : codecov/codecov-action@v2
28
+ flags : oruga-next
29
+ env :
30
+ CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
Original file line number Diff line number Diff line change 4
4
"scripts" : {
5
5
"bootstrap" : " lerna bootstrap" ,
6
6
"test:oruga" : " lerna run test --scope @oruga-ui/oruga" ,
7
+ "test:oruga-next" : " lerna run test --scope @oruga-ui/oruga-next" ,
8
+ "test:watch:oruga-next" : " lerna run test --scope @oruga-ui/oruga-next" ,
7
9
"ci:oruga" : " lerna run ci --scope @oruga-ui/oruga" ,
8
10
"lint:oruga" : " lerna run lint --scope @oruga-ui/oruga" ,
9
11
"lint:fix:oruga" : " lerna run lint:fix --scope @oruga-ui/oruga" ,
Original file line number Diff line number Diff line change @@ -21,3 +21,6 @@ yarn-error.log*
21
21
* .njsproj
22
22
* .sln
23
23
* .sw ?
24
+
25
+ # Cypress
26
+ cypress /videos
Original file line number Diff line number Diff line change 36
36
"build:style:watch" : " concurrently \" sass ../oruga/src/scss/oruga-full-vars.scss dist/oruga-full-vars.css --watch\" \" sass ../oruga/src/scss/oruga.scss dist/oruga.css --watch\" " ,
37
37
"build:lib" : " rimraf dist && npm run build:vue && npm run build:style" ,
38
38
"build:lib:watch" : " npm link && concurrently \" npm run build:vue:watch\" \" npm run build:style:watch\" " ,
39
- "publish:lib" : " cp -R ../oruga/src/scss ./src && cp ../../README.md . && npm run build:lib && npm publish"
39
+ "publish:lib" : " cp -R ../oruga/src/scss ./src && cp ../../README.md . && npm run build:lib && npm publish" ,
40
+ "test" : " rm -rf .nyc_output coverage && NODE_ENV=test cypress run-ct" ,
41
+ "test:watch" : " rm -rf .nyc_output coverage && NODE_ENV=test cypress open-ct"
40
42
},
41
43
"keywords" : [
42
44
" oruga" ,
Original file line number Diff line number Diff line change
1
+ import { mount } from '@cypress/vue'
2
+ import SimpleAutocomplete from './SimpleAutocomplete.vue'
3
+
4
+
5
+ it ( 'Autocomplete' , ( ) => {
6
+ mount ( SimpleAutocomplete )
7
+ cy . get ( 'input' ) . click ( ) . type ( 'j' )
8
+ cy . get ( 'input' ) . type ( '{downarrow}{downarrow}{enter}' )
9
+ cy . get ( 'input' ) . should ( 'have.value' , 'Node.js' )
10
+ } )
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <p class =" content" ><b >Selected:</b > {{ selected }}</p >
3
+ <o-field label =" Find a JS framework" >
4
+ <o-autocomplete
5
+ rounded
6
+ v-model =" name"
7
+ :data =" filteredDataArray"
8
+ placeholder =" e.g. jQuery"
9
+ icon =" search"
10
+ clearable
11
+ @select =" select"
12
+ >
13
+ <template #empty >No results found</template >
14
+ </o-autocomplete >
15
+ </o-field >
16
+ </template >
17
+
18
+ <script lang="ts">
19
+ import { defineComponent } from " vue" ;
20
+ import OAutocomplete from " ../Autocomplete.vue" ;
21
+ import OField from " ../../field/Field.vue" ;
22
+ export default defineComponent ({
23
+ data() {
24
+ return {
25
+ data: [
26
+ " Angular" ,
27
+ " Angular 2" ,
28
+ " Aurelia" ,
29
+ " Backbone" ,
30
+ " Ember" ,
31
+ " jQuery" ,
32
+ " Meteor" ,
33
+ " Node.js" ,
34
+ " Polymer" ,
35
+ " React" ,
36
+ " RxJS" ,
37
+ " Vue.js" ,
38
+ ],
39
+ name: " " ,
40
+ selected: null ,
41
+ };
42
+ },
43
+ components: {
44
+ [OAutocomplete .name ]: OAutocomplete ,
45
+ [OField .name ]: OField ,
46
+ },
47
+ computed: {
48
+ filteredDataArray(): string [] {
49
+ return this .data .filter ((option : any ) => {
50
+ return (
51
+ option .toString ().toLowerCase ().indexOf (this .name .toLowerCase ()) >= 0
52
+ );
53
+ });
54
+ },
55
+ },
56
+ methods: {
57
+ select(option : any ) {
58
+ this .selected = option ;
59
+ },
60
+ },
61
+ });
62
+ </script >
63
+
64
+ <style >
65
+ </style >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ import { mount } from '@cypress/vue'
2
+ import OButton from '../Button.vue'
3
+
4
+ it ( 'Button' , ( ) => {
5
+ mount ( OButton , {
6
+ slots : {
7
+ default : {
8
+ render : ( ) => 'Hello Cypress!'
9
+ }
10
+ }
11
+ } )
12
+
13
+ cy . get ( 'button' ) . contains ( 'Hello Cypress!' ) . click ( )
14
+ } )
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ export default defineConfig({
10
10
include : 'src/*' ,
11
11
exclude : [ "node_modules" , "cypress/" ] ,
12
12
extension : [ ".ts" , ".vue" ] ,
13
+ cypress : true
13
14
} )
14
15
]
15
16
} )
You can’t perform that action at this time.
0 commit comments